[Insight-developers] ShrinkFilter - Bugs from double precision
Luis Ibanez
luis.ibanez at kitware.com
Fri Apr 10 12:52:58 EDT 2009
Bill,
I see, my mistake.
I should have looked closer at the code.
Thanks for the clarification.
Luis
------------------
Bill Lorensen wrote:
> Luis,
>
> Those methods are outside of the loop. They don't affect the
> performance. Brad, replaced the class inside the loop (see comments)
> with optimized code.
>
> Bill
>
> On Fri, Apr 10, 2009 at 11:34 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>>Hi Brad,
>>
>>I thought that in order to reduce computation time we were planning
>>to stay away from the methods:
>>
>> outputPtr->TransformIndexToPhysicalPoint( outputIndex, tempPoint );
>> inputPtr->TransformPhysicalPointToIndex( tempPoint, inputIndex );
>>
>>e.g. lines 253-254...
>>
>>Probably I'm missing something again...
>>
>>
>> Luis
>>
>>--------------------------
>>Bradley Lowekamp wrote:
>>
>>>The committed changes seem to achieve all the goals and desired behavior
>>>everyone has been wanting for this class.
>>>
>>>
>>>http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkShrinkImageFilter.txx?root=Insight&r1=1.58&r2=1.60
>>><http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkShrinkImageFilter.txx?root=Insight&r1=1.58&r2=1.60>
>>>
>>>Any additional feedback or review of these changes would be appreciated
>>>while I still have things fresh in my mind.
>>>
>>>Thanks,
>>>Brad
>>>
>>>
>>>On Apr 9, 2009, at 10:30 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:
>>>
>>>
>>>>Thank you! That explains it!
>>>>
>>>>I am still going to convert what can to index integer arithmetic and the
>>>>remainder I will use your recommendation.
>>>>
>>>>Thanks,
>>>>Brad
>>>>
>>>>On Apr 9, 2009, at 10:14 AM, Tom Vercauteren wrote:
>>>>
>>>>
>>>>>Hi Bradley,
>>>>>
>>>>>This is most certainly related to TransformPhysicalPointToIndex being
>>>>>wrong:
>>>>>http://www.itk.org/Bug/view.php?id=6558
>>>>>
>>>>>Instead of rounding to the nearest integer,
>>>>>TransformPhysicalPointToIndex simply casts the coordinates so if your
>>>>>continuous index is
>>>>> 2.9999999999999999
>>>>>the corresponding index will be
>>>>> 2
>>>>>and not
>>>>> 3
>>>>>
>>>>>I usually stay away from TransformPhysicalPointToIndex and use
>>>>>TransformPhysicalPointToContinuousIndex followed by a loop of
>>>>>vnl_math_round.
>>>>>
>>>>>Tom
>>>>>
>>>>>On Thu, Apr 9, 2009 at 16:01, Bradley Lowekamp <blowekamp at mail.nih.gov
>>>>><mailto:blowekamp at mail.nih.gov>> wrote:
>>>>>
>>>>>
>>>>>>To look into why my changes caused problem, I compared the computed
>>>>>>index
>>>>>
>>>>>>between the ImageBase::Transform and the my supposed optimized
>>>>>>algebraic
>>>>>
>>>>>>equivalent based on integer index operation.
>>>>>
>>_______________________________________________
>>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