Re: [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices?
Matt McCormick <[email protected]>
| Newsgroups | gmane.comp.lib.itk.user |
|---|---|
| Message-ID | <CALzTN-S6DqYdrAh28_ZA9q8riQO_CA7tDtE04OoxteKKcrXitw@mail.gmail.com> |
Yes, that is an issue -- good catch! If we change: internalOutputRegion.SetIndex( internal_i, requestedIndex[i] ); to: internalOutputRegion.SetIndex( internal_i, 0 ); and internalInputRegion.SetIndex( internal_i, this->GetInput(0)->GetRequestedRegion().GetIndex(i) ); to: internalInputRegion.SetIndex( internal_i, 0 ); is the behavior corrected? Thanks, Matt On Fri, Sep 8, 2017 at 11:13 AM, hellman <[email protected]> wrote: > 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/ > _____________________________________ > 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://public.kitware.com/mailman/listinfo/insight-users _____________________________________ 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://public.kitware.com/mailman/listinfo/insight-users