Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 22, 2013
@zmoratto zmoratto IsisIO: Become compliant with ISIS 3.4.3
The dropped the 'get' prefix on some of their methods. They switched
over to QString in more places.
69cb258
@zmoratto zmoratto pprc: Have sub images rendered in parallel with sub_tile_size
Sub_tile_size and sub_theads are still important to make sure that
rendering the low res images doesn't allocate a ton of
GB. Cache_tile_aware_render stop us from notice we had a
problem. However if the sub_scale ration is greater than five ... or
if there just existed a really weird homography, it was possible that
stereo_pprc would try to allocate many GB of ram. This brings down the
system because it is swapping memory so hard.
7a5f8a0
View
22 src/asp/IsisIO/DiskImageResourceIsis.cc
@@ -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;
@@ -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);
@@ -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;
}
}
View
2  src/asp/IsisIO/IsisAdjustCameraModel.cc
@@ -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 {
View
10 src/asp/IsisIO/IsisInterface.cc
@@ -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 ));
@@ -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 );
@@ -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 {
View
16 src/asp/Tools/stereo_pprc.cc
@@ -222,14 +222,9 @@ void stereo_preprocessing( Options& opt ) {
if ( sub_tile_size > vw_settings().default_tile_size() )
sub_tile_size = vw_settings().default_tile_size();
- // Change writing parameters to ideal threads and tiles
vw_out() << "\t--> Creating previews. Subsampling by " << sub_scale
<< " by using " << sub_tile_size << " tile size and "
<< sub_threads << " threads.\n";
- Vector2i previous_tile_size = opt.raster_tile_size;
- opt.raster_tile_size = Vector2i(sub_tile_size,sub_tile_size);
- uint32 previous_num_threads = vw_settings().default_num_threads();
- vw_settings().set_default_num_threads(sub_threads);
// Resample the images and the masks. We must use the masks when
// resampling the images to interpolate correctly around invalid
@@ -244,15 +239,15 @@ void stereo_preprocessing( Options& opt ) {
if ( sub_scale > 0.5 ) {
// When we are near the pixel input to output ratio, standard
// interpolation gives the best possible results.
- left_sub_image = resample(copy_mask(left_image, create_mask(left_mask)), sub_scale);
- right_sub_image = resample(copy_mask(right_image, create_mask(right_mask)), sub_scale);
+ left_sub_image = block_rasterize(resample(copy_mask(left_image, create_mask(left_mask)), sub_scale), sub_tile_size, sub_threads);
+ right_sub_image = block_rasterize(resample(copy_mask(right_image, create_mask(right_mask)), sub_scale), sub_tile_size, sub_threads);
} else {
// When we heavily reduce the image size, super sampling seems
// like the best approach. The method below should be equivalent.
left_sub_image
- = cache_tile_aware_render(resample_aa( copy_mask(left_image,create_mask(left_mask)), sub_scale), Vector2i(256,256) * sub_scale);
+ = block_rasterize(cache_tile_aware_render(resample_aa( copy_mask(left_image,create_mask(left_mask)), sub_scale), Vector2i(256,256) * sub_scale), sub_tile_size, sub_threads);
right_sub_image
- = cache_tile_aware_render(resample_aa( copy_mask(right_image,create_mask(right_mask)), sub_scale), Vector2i(256,256) * sub_scale);
+ = block_rasterize(cache_tile_aware_render(resample_aa( copy_mask(right_image,create_mask(right_mask)), sub_scale), Vector2i(256,256) * sub_scale), sub_tile_size, sub_threads);
}
asp::block_write_gdal_image( opt.out_prefix+"-L_sub.tif",
@@ -267,9 +262,6 @@ void stereo_preprocessing( Options& opt ) {
asp::block_write_gdal_image( opt.out_prefix+"-rMask_sub.tif",
channel_cast_rescale<uint8>(select_channel(right_sub_image, 1)), opt,
TerminalProgressCallback("asp", "\t Sub R Mask: ") );
-
- opt.raster_tile_size = previous_tile_size;
- vw_settings().set_default_num_threads(previous_num_threads);
}
}

No commit comments for this range

Something went wrong with that request. Please try again.