[Insight-users] VS 2010 assertion error after modifying DeformableRegistration15
Bill Lorensen
bill.lorensen at gmail.com
Tue Mar 20 13:00:09 EDT 2012
What error message do you see?
On Tue, Mar 20, 2012 at 9:28 AM, Tim Bhatnagar <tim.bhatnagar at gmail.com> wrote:
> Hello all,
>
> I am trying to modify the deformable registration metric to take a mask-file
> as an input region:
>
> // begin code snippet
>
> typedef itk::ImageMaskSpatialObject< Dimension > MaskType;
>
> MaskType::Pointer spatialObjectMask = MaskType::New();
>
> typedef itk::Image< unsigned char, Dimension > ImageMaskType;
>
> typedef itk::ImageFileReader< ImageMaskType > MaskReaderType;
>
> MaskReaderType::Pointer maskReader = MaskReaderType::New();
>
> maskReader->SetFileName( argv[3] );
>
> try
> {
> maskReader->Update();
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return EXIT_FAILURE;
> }
>
> spatialObjectMask->SetImage( maskReader->GetOutput() );
>
> metric->SetFixedImageMask( spatialObjectMask );
>
> // end code snippet
>
> In the original deformableregistration15 code, these are the only following
> references to 'metric'
>
> /////////
> MetricType::Pointer metric = MetricType::New();
>
> registration->SetMetric( metric );
>
> metric->SetNumberOfHistogramBins( 50 );
>
> metric->ReinitializeSeed( 76926294 );
>
> metric->SetNumberOfSpatialSamples( 10000L ); /// for rigid registration
>
> metric->SetNumberOfSpatialSamples( 50000L ); /// for affine registration
>
> metric->SetNumberOfSpatialSamples( numberOfBSplineParameters * 100 ); ///
> for coarse b-spline reg.
>
> const unsigned long numberOfSamples =
> static_cast<unsigned long>(
> vcl_sqrt( static_cast<double>( numberOfBSplineParameters ) *
> static_cast<double>( numberOfPixels ) ) );
> metric->SetNumberOfSpatialSamples( numberOfSamples ); /// for fine
> b-spline reg.
>
> ////////
>
> I hope this clearly outlines the problem.. I'm a relatively new ITK users
> and I'm still grappling with making small-ish changes to the pre-assembled
> algorithms.
>
> Any help is much appreciated,
>
>
>
> --
> 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
>
>
> _____________________________________
> 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
>
--
Unpaid intern in BillsBasement at noware dot com
More information about the Insight-users
mailing list