[Insight-developers] itk::ImageBase::TransformIndexToPhysicalPoint/TransformPointToContinuousIndex ignores spacing?

Bill Lorensen bill.lorensen at gmail.com
Tue Mar 17 12:01:10 EDT 2009


I believe they do take spacing into account.

On Tue, Mar 17, 2009 at 8:56 AM, kent williams
<norman-k-williams at uiowa.edu> wrote:
> It looks like I'm going to have to roll my own functions to go between
> indices and points for the WarpImageFilter because this doesn't work:
>
> while( !outputIt.IsAtEnd() )
>  {
>  // get the output image index
>  index = outputIt.GetIndex();
>  outputPtr->TransformIndexToPhysicalPoint( index, point );
>
>  typename DeformationFieldInterpolatorType::ContinuousIndexType defIndex;
>  fieldPtr->TransformPhysicalPointToContinuousIndex(point,defIndex);
>  if(!m_DeformationFieldInterpolator->IsInsideBuffer(defIndex))
>    {
>    itkExceptionMacro(<< "Output location outsde DeformationField"
>                      " Buffer" << point);
>    }
>    // get the required displacement
>    displacement =
>    m_DeformationFieldInterpolator->EvaluateAtContinuousIndex(defIndex);
>    // stuff removed
>  }
>
> What I thought would happen (and what the function names seem to imply) is
> that given an IJK index into an image volume, you could get a world
> coordinate system point corresponding to that index.
>
> And conversely, given a point in the WCS, you can retrieve a corresponding
> continuous index.
>
> The problem? These functions don't take spacing into account; so the names
> of the functions are false advertising.  So calling
> TransformPhysicalPointToContinuousIndex with physical point in the output
> image doesn't return a continuous index inside the Deformation Field.
>
> In the particular test I'm working on, the output image has a size of
> 16x16x16 and spacing of 1MM, the deformation field has a size of 8x8x8 and
> spacing of 2MM.
>
> Since this behavior has been written in stone for years I don't imagine it
> will be changed.  But it's a bit disappointing to me.
>
> Is there a way to use the existing ITK physical point/index stuff that takes
> spacing into account?
>
>
>
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> 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-developers
>


More information about the Insight-developers mailing list