<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Nick,<div><br></div><div><br></div><div>Wouldn't a settable global default value be preferred? ie. Set/GetGlobalDefaultCoordinateTolerance.<br><div><br></div><div>Adding yet another CMake variable is rarely preferred, IMHO. </div><div><br></div><div><br></div><div>Also, you mention in the ANTs issue, that it may be related to specific filters such as the Shrink filter. Do you have more specifics or reproducible sequence for this? There are some complexities with how some of the multi-scale filters compute the changing origin, it would not surprise me if there is a minor bug some place for certain more complex images.</div><div><br></div><div>Also related does the nifti file format store this information as doubles or floats?</div><div><br></div><div>Brad</div><div><br><div><div>On Nov 3, 2014, at 11:44 AM, Nicholas Tustison <<a href="mailto:ntustison@gmail.com">ntustison@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Added to this list of suggestions, would it be possible to set a tolerance<div class="">in the list of cmake options?</div><div class=""><br class=""></div><div class="">Nick<br class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 3, 2014, at 8:40 AM, brian avants <<a href="mailto:stnava@gmail.com" class="">stnava@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_signature"><div class="">This email is motivated by this issue:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/stnava/ANTs/issues/74" class="">https://github.com/stnava/ANTs/issues/74</a><br class=""></div><div class=""><br class=""></div><div class="">but it is not isolated to ants.   Worth a read for additional context.</div><div class=""><br class=""></div><div class="">ITK currently enforces a relatively strict check that image and displacement fields "occupy the same physical space."  However, for some unclear (to me) reasons, the direction matrices or origins of images can lose precision when passing through ITK pipelines ( especially through resampling or resolution-changing filters ).  This results in filters aborting and this can occur at various different places in a complex series of ITK-based operations.   </div><div class=""><br class=""></div><div class="">My concern with this is that it can lead to a very severe loss of productivity when this somewhat unpredictable error occurs.   For instance, a user downloads a toolkit based on ITK ( itk-snap, ants, elastic, brainsfit, joint label fusion, etc).   The user expects registration or segmentation filters to "work well" especially when the data is of a standard sort.   Then, after some oft-substantial execution time, this mysterious error appears:</div><div class=""><br class=""></div><div class=""><h3 class="" style="margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:16px;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol'"><a href="https://github.com/stnava/ANTs/issues/31" class="" style="color:rgb(51,51,51);text-decoration:none;background:transparent">itk::ERROR: ImageToImageFilter(0x7fb3b2307ac0): Inputs do not occupy the same physical space!</a></h3></div><div class=""><br class=""></div><div class="">While I am all for correctness, when the impact on productivity exceeds a certain threshold, I think it is useful to bend the rules a bit.   Perhaps one of these would improve the situation:</div><div class=""><br class=""></div><div class="">1)   <span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class=""> </span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class="">change:</span></div><div class=""><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class=""><br class=""></span></div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class="">ITKv4/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class="">and</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class="">ITKv4/Modules/Core/Common/include/itkImageToImageFilter.hxx</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:13.63636302948px;line-height:20.3636360168457px" class="">changing direction tolerance and coordinate tolerance to 1.e-4</p><p style="margin-top:0px;margin-bottom:16px" class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif" class=""><span style="line-height:20.3636360168457px" class=""><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx#L454-L457" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx#L454-L457</a></span></font><br class=""></p><p style="margin-top:0px;margin-bottom:16px" class=""><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageToImageFilter.hxx#L40-L41" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageToImageFilter.hxx#L40-L41</a><br class=""></p><p style="margin-top:0px;margin-bottom:16px" class="">and change the documentation too:</p><p style="margin-top:0px;margin-bottom:16px" class=""><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageToImageFilter.h#L76-L87" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageToImageFilter.h#L76-L87</a><br class=""></p><div class="">2)  Change the exception to a warning.  This would at least allow complex pipelines to execute while notifying the user of a possible issue.</div><div class=""><br class=""></div><div class="">3)  Document all of the places that the user/developer should call:</div><div class=""><br class=""></div><div class=""><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;background-color:rgb(248,238,199)" class="">Set/GetCoordinateTolerance</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;background-color:rgb(248,238,199)" class="">Set/GetDirectionTolerance</span>  .</div><div class=""><br class=""></div><div class="">This last solution would require adding Set/GetCoordinate and Direction tolerance to:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.h" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.h</a><br class=""></div><div class=""><br class=""></div><div class="">as well, for consistency. </div><div class=""><br class=""></div><div class="">Anyway, I raise this issue b/c of the many man and computer hours lost by this check.</div><div class=""><br class=""></div><div class="">Not once has this check actually helped us, in any measurable way, avoid errors.</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div>
</div>
_______________________________________________<br class="">Powered by <a href="http://www.kitware.com/" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class=""><a href="http://kitware.com/products/protraining.php">http://kitware.com/products/protraining.php</a><br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-developers<br class=""></div></blockquote></div><br class=""></div></div></div>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/insight-developers<br></blockquote></div><br></div></div></body></html>