<div dir="ltr">so - just to be clear ... same thing needs to be done here:<div><br></div><div><p style="font-size:13.63636302948px;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;line-height:20.3636360168457px">ITKv4/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.h</p><p style="font-size:13.63636302948px;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;line-height:20.3636360168457px">and how does <span style="font-size:13.3333339691162px;line-height:normal;color:rgb(34,34,34);font-family:arial,sans-serif">Get/</span><span style="font-size:13.3333339691162px;line-height:normal;color:rgb(34,34,34);font-family:arial,sans-serif">SetGlobalDefault  differ from  </span><span style="color:rgb(153,153,136);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.8181819915771px;font-style:italic;line-height:15.27272605896px;white-space:pre-wrap;background-color:rgb(248,238,199)">Set/GetCoordinateTolerance</span><span style="font-size:13.3333339691162px;line-height:normal;color:rgb(34,34,34);font-family:arial,sans-serif">  </span><span style="color:rgb(153,153,136);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:11.8181819915771px;font-style:italic;line-height:15.27272605896px;white-space:pre-wrap;background-color:rgb(248,238,199)">Set/GetDirectionTolerance</span><span style="font-size:13.3333339691162px;line-height:normal;color:rgb(34,34,34);font-family:arial,sans-serif">  </span></p><p style="font-size:13.63636302948px;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;line-height:20.3636360168457px"><span style="font-size:13.3333339691162px;line-height:normal;color:rgb(34,34,34);font-family:arial,sans-serif">which already exists in the image to image filter (but not displacement field)?</span></p></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div><br></div>brian<br><div><br></div><div><br></div></div></div>
<br><div class="gmail_quote">On Tue, Nov 4, 2014 at 9:26 AM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I agree that would be good.<div><br></div><div>The other thing which can be done concurrently is add the ImageToImageFilter::Get/SetGlobalDefault methods. Any one want to volunteer for that one?</div><div><br></div><div>Brad</div><div><div class="h5"><div><br><div><div>On Nov 4, 2014, at 9:21 AM, brian avants <<a href="mailto:stnava@gmail.com" target="_blank">stnava@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">i guess the next step is to dig up a couple of examples of this behavior and post them somewhere.   </div><div class="gmail_extra"><br clear="all"><div><div><div><br></div>brian<br><div><br></div><div><br></div></div></div>
<br><div class="gmail_quote">On Tue, Nov 4, 2014 at 9:14 AM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That is a question: why is an exact copy not happening? Is is due to runtime errors or accumulation of errors during IO?<br>
<br>
Brad<br>
<div><div><br>
<br>
On Nov 4, 2014, at 3:51 AM, <<a href="mailto:M.Staring@lumc.nl" target="_blank">M.Staring@lumc.nl</a>> <<a href="mailto:M.Staring@lumc.nl" target="_blank">M.Staring@lumc.nl</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> Would it be possible to fix this issue by passing the physical space by reference, or by performing an exact copy?<br>
><br>
> Regards, Marius<br>
><br>
>> -----Original Message-----<br>
>> From: Insight-developers [mailto:<a href="mailto:insight-developers-bounces@itk.org" target="_blank">insight-developers-bounces@itk.org</a>] On<br>
>> Behalf Of Matt McCormick<br>
>> Sent: maandag 3 november 2014 18:39<br>
>> To: brian avants<br>
>> Cc: <a href="mailto:Insight-developers@itk.org" target="_blank">Insight-developers@itk.org</a><br>
>> Subject: Re: [ITK-dev] image and deformation field physical space check<br>
>><br>
>> Hi Brian,<br>
>><br>
>> Thanks for discussing this.<br>
>><br>
>> I think a combination of fixing the underlying issue that is being brought up by<br>
>> the exception, relaxing the tolerance, and improving the documentation is a<br>
>> good approach.<br>
>><br>
>> 2 cents,<br>
>> Matt<br>
>><br>
>> On Mon, Nov 3, 2014 at 11:40 AM, brian avants <<a href="mailto:stnava@gmail.com" target="_blank">stnava@gmail.com</a>> wrote:<br>
>>> This email is motivated by this issue:<br>
>>><br>
>>> <a href="https://github.com/stnava/ANTs/issues/74" target="_blank">https://github.com/stnava/ANTs/issues/74</a><br>
>>><br>
>>> but it is not isolated to ants.   Worth a read for additional context.<br>
>>><br>
>>> ITK currently enforces a relatively strict check that image and<br>
>>> displacement fields "occupy the same physical space."  However, for<br>
>>> some unclear (to me) reasons, the direction matrices or origins of<br>
>>> images can lose precision when passing through ITK pipelines (<br>
>>> especially through resampling or resolution-changing filters ).  This<br>
>>> results in filters aborting and this can occur at various different<br>
>>> places in a complex series of ITK-based operations.<br>
>>><br>
>>> My concern with this is that it can lead to a very severe loss of<br>
>>> productivity when this somewhat unpredictable error occurs.   For instance,<br>
>>> a user downloads a toolkit based on ITK ( itk-snap, ants, elastic,<br>
>>> brainsfit, joint label fusion, etc).   The user expects registration or<br>
>>> segmentation filters to "work well" especially when the data is of a<br>
>>> standard sort.   Then, after some oft-substantial execution time, this<br>
>>> mysterious error appears:<br>
>>><br>
>>> itk::ERROR: ImageToImageFilter(0x7fb3b2307ac0): Inputs do not occupy<br>
>>> the same physical space!<br>
>>><br>
>>><br>
>>> While I am all for correctness, when the impact on productivity exceeds a<br>
>>> certain threshold, I think it is useful to bend the rules a bit.   Perhaps<br>
>>> one of these would improve the situation:<br>
>>><br>
>>> 1)    change:<br>
>>><br>
>>> ITKv4/Modules/Filtering/DisplacementField/include/itkDisplacementField<br>
>>> Transform.hxx<br>
>>><br>
>>> and<br>
>>><br>
>>> ITKv4/Modules/Core/Common/include/itkImageToImageFilter.hxx<br>
>>><br>
>>> changing direction tolerance and coordinate tolerance to 1.e-4<br>
>>><br>
>>> <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/F" target="_blank">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/F</a><br>
>>> iltering/DisplacementField/include/itkDisplacementFieldTransform.hxx#L<br>
>>> 454-L457<br>
>>><br>
>>> <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/C" target="_blank">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/C</a><br>
>>> ore/Common/include/itkImageToImageFilter.hxx#L40-L41<br>
>>><br>
>>> and change the documentation too:<br>
>>><br>
>>> <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/C" target="_blank">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/C</a><br>
>>> ore/Common/include/itkImageToImageFilter.h#L76-L87<br>
>>><br>
>>> 2)  Change the exception to a warning.  This would at least allow<br>
>>> complex pipelines to execute while notifying the user of a possible issue.<br>
>>><br>
>>> 3)  Document all of the places that the user/developer should call:<br>
>>><br>
>>> Set/GetCoordinateTolerance  Set/GetDirectionTolerance  .<br>
>>><br>
>>> This last solution would require adding Set/GetCoordinate and<br>
>>> Direction tolerance to:<br>
>>><br>
>>> <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/F" target="_blank">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/F</a><br>
>>> iltering/DisplacementField/include/itkDisplacementFieldTransform.h<br>
>>><br>
>>> as well, for consistency.<br>
>>><br>
>>> Anyway, I raise this issue b/c of the many man and computer hours lost<br>
>>> by this check.<br>
>>><br>
>>> Not once has this check actually helped us, in any measurable way,<br>
>>> avoid errors.<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>><br>
>>> Kitware offers ITK Training Courses, for more information visit:<br>
>>> <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
>>><br>
>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mailman/listinfo/insight-developers</a><br>
>>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Kitware offers ITK Training Courses, for more information visit:<br>
>> <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
>><br>
>> Please keep messages on-topic and check the ITK FAQ at:<br>
>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mailman/listinfo/insight-developers</a><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mailman/listinfo/insight-developers</a><br>
<br>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>