[ITK Community] [Insight-users] placing my ->Update() properly
Tim Bhatnagar
tim.bhatnagar at gmail.com
Thu Dec 5 20:51:48 EST 2013
hello all,
I am receiving a "largest possible region does not fully contain requested
paste..." error on execution of my program.. I'm fairly certain I have
botched my pipeline flow.. can anyone point out the error for me?
******************************************
reader->SetFileName( argv[1] );
reader->Update();
// Obtaining an input displacement field
DisplacementFieldType::Pointer field = reader->GetOutput();
DisplacementFieldType::RegionType region =
field->GetLargestPossibleRegion();
itk::ImageRegionIteratorWithIndex< DisplacementFieldType > it( field,
region );
filter->SetInput( reader->GetOutput() );
filter->SetSubsamplingFactor( 16 );
filter->Update();
try
{
filter->UpdateLargestPossibleRegion();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << "Exception thrown " << std::endl;
std::cerr << excp << std::endl;
}
// Write an image for regression testing
typedef itk::ImageFileWriter< DisplacementFieldType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput (filter->GetOutput() );
writer->SetFileName( argv[2] );
try
{
writer->Update();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << "Exception thrown by writer" << std::endl;
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
****************************
Many thanks!
--
Tim Bhatnagar
PhD Candidate
Orthopaedic Injury Biomechanics Group
Department of Mechanical Engineering
University of British Columbia
Rm 5000 - 818 West 10th Ave.
Vancouver, BC
Canada
V5Z 1M9
Ph: (604) 675-8845
Fax: (604) 675-8820
Web: oibg.mech.ubc.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131205/5d34c2ef/attachment-0001.htm>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
More information about the Community
mailing list