Skip to content

Commit

Permalink
IsisIO: Become compliant with ISIS 3.4.3
Browse files Browse the repository at this point in the history
The dropped the 'get' prefix on some of their methods. They switched
over to QString in more places.
  • Loading branch information
Zack Moratto committed Mar 22, 2013
1 parent 22abd9b commit 69cb258
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions src/asp/IsisIO/DiskImageResourceIsis.cc
Expand Up @@ -63,18 +63,18 @@ namespace vw {
void DiskImageResourceIsis::open(std::string const& filename) {
m_cube = boost::shared_ptr<Isis::Cube>( new Isis::Cube() );
m_filename = filename;
m_cube->open( m_filename );
m_cube->open( QString::fromStdString(m_filename) );
VW_ASSERT( m_cube->isOpen(),
IOErr() << "DiskImageResourceIsis: Could not open cube file: \"" << filename << "\"." );

// Extract the dimensions of the image
m_format.planes = m_cube->getBandCount();
m_format.cols = m_cube->getSampleCount();
m_format.rows = m_cube->getLineCount();
m_format.planes = m_cube->bandCount();
m_format.cols = m_cube->sampleCount();
m_format.rows = m_cube->lineCount();

m_format.pixel_format = VW_PIXEL_SCALAR;

Isis::PixelType isis_ptype = m_cube->getPixelType();
Isis::PixelType isis_ptype = m_cube->pixelType();
switch (isis_ptype) {
case Isis::UnsignedByte:
m_bytes_per_pixel = 1;
Expand Down Expand Up @@ -116,16 +116,16 @@ namespace vw {
/// Read the disk image into the given buffer.
void DiskImageResourceIsis::read(ImageBuffer const& dest, BBox2i const& bbox) const
{
VW_ASSERT(bbox.max().x() <= m_cube->getSampleCount() ||
bbox.max().y() <= m_cube->getLineCount(),
VW_ASSERT(bbox.max().x() <= m_cube->sampleCount() ||
bbox.max().y() <= m_cube->lineCount(),
IOErr() << "DiskImageResourceIsis: requested bbox " << bbox
<< " exceeds image dimensions [" << m_cube->getSampleCount()
<< " " << m_cube->getLineCount() << "]");
<< " exceeds image dimensions [" << m_cube->sampleCount()
<< " " << m_cube->lineCount() << "]");

// Read in the requested tile from the cube file. Note that ISIS
// cube pixel indices appear to be 1-based.
Isis::Portal buffer( bbox.width(), bbox.height(),
m_cube->getPixelType() );
m_cube->pixelType() );
buffer.SetPosition(bbox.min().x()+1, bbox.min().y()+1, 1);
m_cube->read(buffer);

Expand Down Expand Up @@ -213,6 +213,6 @@ namespace vw {
bool DiskImageResourceIsis::is_map_projected() const {
// They used to have a HasProjection. I'm not sure if this fix is
// the correct method now.
return m_cube->getProjection() != NULL;
return m_cube->projection() != NULL;
}
}
2 changes: 1 addition & 1 deletion src/asp/IsisIO/IsisAdjustCameraModel.cc
Expand Up @@ -189,7 +189,7 @@ IsisAdjustCameraModel::camera_pose( Vector2 const& pix ) const {

std::string IsisAdjustCameraModel::serial_number() const {
Isis::Pvl copy( m_label );
return Isis::SerialNumber::Compose( copy, true );
return Isis::SerialNumber::Compose( copy, true ).toStdString();
}

double IsisAdjustCameraModel::ephemeris_time( Vector2 const& pix ) const {
Expand Down
10 changes: 5 additions & 5 deletions src/asp/IsisIO/IsisInterface.cc
Expand Up @@ -40,9 +40,9 @@ using namespace asp::isis;

IsisInterface::IsisInterface( std::string const& file ) {
// Opening labels and camera
Isis::FileName cubefile( file.c_str() );
Isis::FileName ifilename( QString::fromStdString(file) );
m_label.reset( new Isis::Pvl() );
m_label->Read( cubefile.expanded() );
m_label->Read( ifilename.expanded() );

// Opening Isis::Camera
m_camera.reset(Isis::CameraFactory::Create( *m_label ));
Expand All @@ -52,9 +52,9 @@ IsisInterface::~IsisInterface() {}

IsisInterface* IsisInterface::open( std::string const& filename ) {
// Opening Labels (This should be done somehow though labels)
Isis::FileName cubefile( filename.c_str() );
Isis::FileName ifilename( QString::fromStdString(filename) );
Isis::Pvl label;
label.Read( cubefile.expanded() );
label.Read( ifilename.expanded() );

Isis::Camera* camera = Isis::CameraFactory::Create( label );

Expand Down Expand Up @@ -92,7 +92,7 @@ int IsisInterface::samples() const {

std::string IsisInterface::serial_number() const {
Isis::Pvl copy( *m_label );
return Isis::SerialNumber::Compose( copy, true );
return Isis::SerialNumber::Compose( copy, true ).toStdString();
}

double IsisInterface::ephemeris_time( vw::Vector2 const& pix ) const {
Expand Down

0 comments on commit 69cb258

Please sign in to comment.