<div dir="ltr">Hi,<br>I've found the problem. The class HDF5TransformIOTemplate makes an extension check. After change the transform output file to Transforms.hdf, works fine.<br>I think this needs to be changed on Example and on book, since explicity talks: <br>
<br> // Then we set the filename using the SetFileName() function. The file's extension<br> // does not matter for the transform reader/writer. Then we call the Update()<br> // function to write the transform(s) onto the disk.<br>
<br>The changed code are above:<br><br>template< typename TInternalComputationValueType ><br><br>bool<br><br>HDF5TransformIOTemplate< TInternalComputationValueType ><br><br>::CanWriteFile(const char *fileName)<br>
<br>{<br><br> //<br><br> // all extensions mentioned in wikipedia + 'hd5'<br><br> // actually HDF doesn't care about extensions at<br><br> // all and this is just by convention.<br><br> const char *extensions[] =<br>
<br> {<br><br> ".hdf",".h4",".hdf4",".h5",".hdf5",".he4",".he5",".hd5",0,<br><br> };<br><br> std::string ext<br><br> (itksys::SystemTools::GetFilenameLastExtension(fileName));<br>
<br> for(unsigned i = 0; extensions[i] != 0; i++)<br><br> {<br><br> if(ext == extensions[i])<br><br> {<br><br> return true;<br><br> }<br><br> }<br><br> return false;<br><br>}<div><br><div>Regards,</div>
<div><br></div><div>Wagner Sales</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-04 18:41 GMT-03:00 Wagner Sales <span dir="ltr"><<a href="mailto:wsales@gmail.com" target="_blank">wsales@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm trying to save transforms and catching an strange error. I tried to execute the simple example on IO directory to validate this, and:</div>
<div><br></div><div>--> checking permission</div>
<div><div>wsales@wsales-desktop:/tmp/trf$ touch ihavepermission<br></div><div>wsales@wsales-desktop:/tmp/trf$ ls -la</div><div>total 28464</div><div>drwxrwxr-x 2 wsales wsales 4096 Jul 4 17:52 .</div><div>drwxrwxrwt 31 root root 12288 Jul 4 17:52 ..</div>
<div>-rw-rw-r-- 1 wsales wsales 0 Jul 4 17:52 ihavepermission</div><div>-rwxrwxr-x 1 wsales wsales 29128152 Jul 4 17:52 TransformReadWrite</div><div><br></div><div>wsales@wsales-desktop:/tmp/trf$ ./TransformReadWrite test</div>
<div>Error while saving the transforms</div><div><br></div><div>itk::ExceptionObject (0x2af4c30)</div><div>Location: "void itk::TransformFileWriterTemplate<ScalarType>::Update() [with ScalarType = double]" </div>
<div>File: /home/wsales/Sources/InsightToolkit-4.5.2/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx</div><div>Line: 200</div><div>Description: itk::ERROR: TransformFileWriterTemplate(0x2ae6300): Can't Create IO object for file Transforms.meta</div>
</div><div><br></div><div>Since I can create the file, problem with permissions is not the issue.</div><div>About my system ( latest Ubuntu, 'll update today ):</div><div><div>uname -a</div><div>Linux wsales-desktop 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux</div>
</div><div><br></div><div>Compiler:</div><div><div>clang --version</div><div>Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)</div><div>Target: x86_64-pc-linux-gnu</div><div>Thread model: posix</div>
</div><div><br></div><div>Some idea about this? </div><div>This example was worked fine to me on ITK 3.20, before my version upgrade. </div><div><br></div><div>Regards,</div><div><br></div><div>Wagner Sales</div><div><br>
</div><div><br></div><div><br></div></div>
</blockquote></div><br></div>