+ typedef itk::MinimumMaximumImageCalculator< _TImage > _TMinMax;
+ typedef itk::ImageSliceIteratorWithIndex< _TImage > _T3DIt;
+ typedef itk::ImageRegionIterator< typename TSlicer::TSliceImage > _T2DIt;
+
+ auto input = this->GetInput( );
+ auto curve = this->GetCurve( );
+ auto output = this->GetOutput( );
+
+ // Compute image intensity range
+ typename _TMinMax::Pointer minmax = _TMinMax::New( );
+ minmax->SetImage( input );
+ minmax->Compute( );
+
+ // Prepare slicer
+ typename TSlicer::Pointer slicer = TSlicer::New( );
+ slicer->SetInput( input );
+ slicer->SetDefaultValue( minmax->GetMinimum( ) );
+ slicer->SpacingFromMinimumOn( );
+ if( this->m_Interpolator.IsNotNull( ) )
+ slicer->SetInterpolator( this->m_Interpolator );
+ slicer->SizeFromMaximumOff( );
+ if( this->m_SliceRadius > double( 0 ) )
+ {
+ slicer->SizeFromMinimumOff( );
+ slicer->SetSize( this->m_SliceRadius );
+ }
+ else
+ slicer->SizeFromMinimumOn( );
+
+ // Slice image
+ _T3DIt oIt( output, output->GetRequestedRegion( ) );
+ oIt.SetFirstDirection( 1 );
+ oIt.SetSecondDirection( 2 );
+ oIt.GoToBegin( );
+ unsigned long N = curve->GetNumberOfPoints( );
+ for( unsigned long n = 0; n < N; ++n )
+ {
+ slicer->SetTranslation( curve->GetPoint( n ) );
+ slicer->SetRotation( curve->GetFrame( n ) );
+ slicer->Update( );
+
+ // Fill output image
+ _T2DIt sIt(
+ slicer->GetOutput( ), slicer->GetOutput( )->GetRequestedRegion( )
+ );
+ for( sIt.GoToBegin( ); !sIt.IsAtEnd( ); ++sIt )
+ {
+ oIt.Set( sIt.Get( ) );
+ ++oIt;
+ if( oIt.IsAtEndOfLine( ) )
+ oIt.NextLine( );
+ if( oIt.IsAtEndOfSlice( ) )
+ oIt.NextSlice( );
+
+ } // rof
+
+ } // rof