<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-CA;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-CA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>“TransformFileWriter” string is found in 10 Slicer files.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Andras<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> insight-developers-bounces@itk.org [mailto:insight-developers-bounces@itk.org] <b>On Behalf Of </b>Jean-Christophe Fillion-Robin<br><b>Sent:</b> July 26, 2013 9:38 PM<br><b>To:</b> Bill Lorensen<br><b>Cc:</b> Ghayoor, Ali; Johnson, Hans J; insight-developers@itk.org<br><b>Subject:</b> Re: [Insight-developers] Recent changes to Transforms break ITK's API<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Regarding Slicer, couldn't find any occurrences of "TranformWriter" string in the code base.<o:p></o:p></p><div><p class=MsoNormal>Jc<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Fri, Jul 26, 2013 at 3:25 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>> wrote:<o:p></o:p></p><div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>I guess I can put an ITK version #ifdef guard around the code.<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>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.<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>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.<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>Also, it would be great if the migration guide was up-to-date and kept up-to-date.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div></div></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Fri, Jul 26, 2013 at 3:02 PM, Johnson, Hans J <<a href="mailto:hans-johnson@uiowa.edu" target="_blank">hans-johnson@uiowa.edu</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>All,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>Ali is working on a solution that works similar to the Image readers/writers so that.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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. <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>====================================<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>To make the old code work, you now would need to specify that you wish to write the transform as float<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>TranformWriterTemplate<float> and the code would now have the correct behavior.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>It is backwards compatible with double (the most common and previously correct case) because TransformWriter is an alias to TrasnformWriterTemplate<double><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx: typedef itk::TransformFileWriterTemplate<double> TransformWriterType;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>Hans<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From: </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br><b>Date: </b>Friday, July 26, 2013 1:37 PM<br><b>To: </b>Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>><br><b>Cc: </b>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><b>Subject: </b>Re: [Insight-developers] Recent changes to Transforms break ITK's API<o:p></o:p></span></p></div><div><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div><div><div><div><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>My main concern is that old code generates a compiler error that gives no clue as to what is wrong.<o:p></o:p></span></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>On Fri, Jul 26, 2013 at 2:16 PM, Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>> wrote:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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<o:p></o:p></span></p><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><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>> ________________________________<o:p></o:p></span></p></div></div></div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><br><br clear=all><br>-- <br>Unpaid intern in BillsBasement at noware dot com<o:p></o:p></span></p></div></div></div></div></div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><hr size=2 width="100%" align=center></span></div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'>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. <o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:10.5pt;font-family:"Calibri","sans-serif"'><hr size=2 width="100%" align=center></span></div></div></div></div></div><p class=MsoNormal><br><br clear=all><br>-- <br>Unpaid intern in BillsBasement at noware dot com<o:p></o:p></p></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <br>+1 919 869 8849<o:p></o:p></p></div></div></body></html>