It seems that the Image IO Factory does not run well.<div>In order to create a png image, I have to add the following code :</div><div><br></div><div><div> typedef itk::ImageFileWriter< ImageType > WriterType;</div>
<div> WriterType::Pointer writer = WriterType::New();</div><div> writer->SetFileName(outputFilename);</div><div> writer->SetInput(image);</div><div><br></div><div> writer->SetImageIO(PNGImageIO::New()); // New Line</div>
<div><br></div><div> writer->Update();</div><div><br></div><div>So, it seems complicated. :)</div><div>Thuan</div><br><div class="gmail_quote">2011/11/18 Vu Hong Thuan <span dir="ltr"><<a href="mailto:thuanvh@gmail.com">thuanvh@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yes, I do. :) I have got 77 files .lib in the lib folder. :)<div>And I build successfully the example, only get the error in the runtime.<div>
<div class="h5"><br><br><div class="gmail_quote">2011/11/18 Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When you built ITKv4 did you build with all of the modules,<br>
ITK_BUILD_ALL_MODULES ON?<br>
<br>
If you are running the examples, you should probably build all of the modules.<br>
<div><div><br>
On Thu, Nov 17, 2011 at 8:28 PM, Vu Hong Thuan <<a href="mailto:thuanvh@gmail.com" target="_blank">thuanvh@gmail.com</a>> wrote:<br>
> Hi,<br>
> I built the example of writing file:<br>
> <a href="http://www.vtk.org/Wiki/ITK/Examples/IO/ImageFileWriter" target="_blank">http://www.vtk.org/Wiki/ITK/Examples/IO/ImageFileWriter</a><br>
> with visual C++ and I get the error of writing file png.<br>
> And I think the reason that m_RegisteredFactories is not initialized well?<br>
> Thuan,<br>
><br>
> 2011/11/18 Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>><br>
>><br>
>> ITKv4 supports the writing of .mha and .mhd.<br>
>><br>
>> Can you provide an example that fails?<br>
>><br>
>> On Thu, Nov 17, 2011 at 4:30 AM, Vu Hong Thuan <<a href="mailto:thuanvh@gmail.com" target="_blank">thuanvh@gmail.com</a>> wrote:<br>
>> > Hi all,<br>
>> > I start to use the latest version of itk (4.0rc20). But I meet an error<br>
>> > in<br>
>> > creating file mha or mhd format.<br>
>> > Description: Could not create IO object for file<br>
>> > outputImageBsplineFine.mhd<br>
>> > Tried to create one of the following:<br>
>> > You probably failed to set a file suffix, or<br>
>> > set the suffix to an unsupported type.<br>
>> > I think this is bug of itk. Do you support the writing .mha or .mhd<br>
>> > format<br>
>> > in this version?<br>
>> > Thanks.<br>
>> > Thuan.<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://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</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-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Unpaid intern in BillsBasement at noware dot com<br>
><br>
><br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>