<div dir="ltr">Regarding Slicer, couldn't find any occurrences of "TranformWriter" string in the code base.<div style>Jc</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 26, 2013 at 3:25 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I guess I can put an ITK version #ifdef guard around the code.<br><br></div>I don't want to be a PITA about this. But a non-sophisticated customer would not have a clue how to change their code by looking at the compiler errors.<br>
<br></div>Is there something we could do with partial specialization? If the code uses a bad type, we could put a warning pragma of runtime warning that tells the user explicitly what to do.<br><br></div>Also, it would be great if the migration guide was up-to-date and kept up-to-date.<br>
<br><div><br><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 26, 2013 at 3:02 PM, Johnson, Hans J <span dir="ltr"><<a href="mailto:hans-johnson@uiowa.edu" target="_blank">hans-johnson@uiowa.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>All,</div>
<div><br>
</div>
<div>Ali is working on a solution that works similar to the Image readers/writers so that.</div>
<div><br>
</div>
<div>I would argue that the old code in the example is an example of what was possible, but only in the most limited of uses. </div>
<div><br>
</div>
<div>It is very unlikely that this code exists in end users applications because transforms with floating point were not possible from the registration framework, and could not have been used in any of the optimizers, or in anything that used the Get/SetParameters
or Get/SetFixedParameters API. Additionally, the files written to disk would have been written and read as double precision numbers.</div>
<div><br>
</div>
<div>In short, the only transforms that could exists in float are those that are manually initialized, and then they could only be used for transforming points. All other update or optimization operations would have (and did) give compiler errors.</div>
<div><br>
</div>
<div>====================================</div>
<div><br>
</div>
<div>Over the past year there has been much discussion of the need for being able to do registrations in floating point (especially under the ITKv4 registration framework), and this looks like the only way that we (several people have looked at this) could
see for moving forward.</div>
<div><br>
</div>
<div>I welcome any suggestions on how to preserve backwards compatibility, but I agree with Matt that the previous behavior was not correct, and I would rather not continue to provide that wrong behavior. In my mind this is an example of: PREFER COMPILE TIME
ERROR TO RUNTIME ERROR.</div>
<div><br>
</div>
<div>To make the old code work, you now would need to specify that you wish to write the transform as float</div>
<div><br>
</div>
<div>TranformWriterTemplate<float> and the code would now have the correct behavior.</div>
<div><br>
</div>
<div>It is backwards compatible with double (the most common and previously correct case) because TransformWriter is an alias to TrasnformWriterTemplate<double></div>
<div><br>
</div>
<div>Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx: typedef itk::TransformFileWriterTemplate<double> TransformWriterType;</div>
<div><br>
</div>
<div>Hans</div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">
<span style="font-weight:bold">From: </span>Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Friday, July 26, 2013 1:37 PM<br>
<span style="font-weight:bold">To: </span>Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>><br>
<span style="font-weight:bold">Cc: </span>Ali Ghayoor <<a href="mailto:ali-ghayoor@uiowa.edu" target="_blank">ali-ghayoor@uiowa.edu</a>>, ITK <<a href="mailto:insight-developers@itk.org" target="_blank">insight-developers@itk.org</a>>, Hans Johnson <<a href="mailto:hans-johnson@uiowa.edu" target="_blank">hans-johnson@uiowa.edu</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Insight-developers] Recent changes to Transforms break ITK's API<br>
</div><div><div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>
<div>My main concern is that old code generates a compiler error that gives no clue as to what is wrong.<br>
</div>
What info can we provide to the customer to help fix this error. I see nothing in the migration guide. In fact, that guide has not been updated since last November.<br>
<br>
</div>
Even a warning would be useful with explicit instructions on what to change. My case was simple for me to fix because I knew something had changed in the transforms and the code base was small. Pity thepoor customer with a large investment in using ITK code.<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Jul 26, 2013 at 2:16 PM, Matt McCormick <span dir="ltr">
<<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Ali,<br>
<br>
If a float transform was saved as a double on disk, that could be<br>
considered a bug and I do not think there is harm in fixing the<br>
behavior. We still should fix the compliation IMHO.<br>
<br>
Thanks,<br>
Matt<br>
<div>
<div><br>
On Fri, Jul 26, 2013 at 1:37 PM, Ghayoor, Ali <<a href="mailto:ali-ghayoor@uiowa.edu" target="_blank">ali-ghayoor@uiowa.edu</a>> wrote:<br>
> Hello All,<br>
><br>
> As Bill Lorensen has proven in his example, the new changes to ITK, due to<br>
> the "ENH: Support single precision registration" patch, break API of<br>
> "itkTransformFileReader/Writer" filters.<br>
><br>
> In attached report file, I have explained about the importance of new<br>
> changes, and the current backward compatibility issues that they cause.<br>
> Also, it is shown that the old functionality had a bug in it, and moving<br>
> forward this bug should not be re-introduced.<br>
><br>
> I really appreciate if you ITK gurus take a look at this report and tell<br>
> your ideas about the new changes.<br>
><br>
> Thank you,<br>
> Ali<br>
><br>
><br>
><br>
> From: Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br>
> Date: Sunday, July 14, 2013 10:31 AM<br>
> To: ITK <<a href="mailto:insight-developers@itk.org" target="_blank">insight-developers@itk.org</a>><br>
> Subject: [Insight-developers] Recent changes to Transforms break ITK's API<br>
><br>
> Folks,<br>
><br>
> When I compile the following code I get this compilation error:<br>
><br>
> /home/lorensen/ProjectsGIT/ITKGerrit/Modules/Remote/WikiExamples/IO/TransformFileWriter.cxx:<br>
> In function ‘int main(int, char**)’:<br>
> /home/lorensen/ProjectsGIT/ITKGerrit/Modules/Remote/WikiExamples/IO/TransformFileWriter.cxx:20:<br>
> error: no matching function for call to<br>
> ‘itk::TransformFileWriterTemplate<double>::SetInput(itk::SmartPointer<itk::Rigid2DTransform<float><br>
>>&)’<br>
> /home/lorensen/ProjectsGIT/ITKGerrit/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx:78:<br>
> note: candidates are: void<br>
> itk::TransformFileWriterTemplate<ScalarType>::SetInput(const<br>
> itk::TransformBaseTemplate<TScalarType>*) [with ScalarType = double]<br>
><br>
> ---------------------------------------------------------------------------------------------------<br>
> #include "itkRigid2DTransform.h"<br>
> #include "itkTransformFileWriter.h"<br>
><br>
> int main(int argc, char *argv[])<br>
> {<br>
> std::string fileName;<br>
> if(argc == 1) // No arguments were provided<br>
> {<br>
> fileName = "test.tfm";<br>
> }<br>
> else<br>
> {<br>
> fileName = argv[1];<br>
> }<br>
><br>
> typedef itk::Rigid2DTransform< float > TransformType;<br>
> TransformType::Pointer transform = TransformType::New();<br>
><br>
> itk::TransformFileWriter::Pointer writer =<br>
> itk::TransformFileWriter::New();<br>
> writer->SetInput(transform);<br>
> writer->SetFileName(fileName);<br>
> writer->Update();<br>
><br>
> return EXIT_SUCCESS;<br>
> }<br>
><br>
><br>
><br>
> ________________________________<br>
> Notice: This UI Health Care e-mail (including attachments) is covered by the<br>
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential<br>
> and may be legally privileged. If you are not the intended recipient, you<br>
> are hereby notified that any retention, dissemination, distribution, or<br>
> copying of this communication is strictly prohibited. Please reply to the<br>
> sender that you have received the message in error, then delete it. Thank<br>
> you.<br>
> ________________________________<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Unpaid intern in BillsBasement at noware dot com<br>
</div>
</div>
</div>
</div></div></span><div><div><br>
<br>
<hr>
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.
<hr>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>
</div></div><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://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br>
</div>