[ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices?

hellman fredrik.hellman at gmail.com
Fri Sep 8 11:13:24 EDT 2017


I am not sure. In SliceBySliceImageFilter.hxx for ITK 4.12.0, on line 188, it
says:

  // copy the requested region to the internal slice region in
  // dimension order
  unsigned int internal_i = 0;
  for ( unsigned int i = 0; internal_i < InternalImageDimension; ++i,
++internal_i )
    {
    if ( i == this->m_Dimension )
      {
      ++i;
      }
    internalOutputRegion.SetSize( internal_i, requestedSize[i] );
    internalOutputRegion.SetIndex( internal_i, requestedIndex[i] );

    internalInputRegion.SetSize( internal_i,
this->GetInput(0)->GetRequestedRegion().GetSize(i) );
    internalInputRegion.SetIndex( internal_i,
this->GetInput(0)->GetRequestedRegion().GetIndex(i) );

    }

This will copy all indices (except the slicing dimension) of input 0 to
internalInputRegion, which is set as the regions for the internal image
further down. In my case, the 5s get copied here.

I have also stopped in a debugger in ImageToImageFilter (of my
BinaryFunctorImageFilter) where the check that the physical regions overlap
is performed. At this point, both images have the same region index [5, 5],
but one image has origin (0, 0) and the sliced image has origin (1.5, 1.5). 




--
Sent from: http://itk-users.7.n7.nabble.com/


More information about the Insight-users mailing list