<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hello All,<br><br>&nbsp;&nbsp; I have written a simple program to write out a JPG image of input data. all is well and internediate results of my program are correct. However, when I try to write the jpg, then program crashes. Here is teh code snippet.&nbsp; Please suggest some tips to identify/correct the problem. The program crashes when Update() is called and program counter is in CreateImageIO function.&nbsp; The input image, 'mask' seems to be set correctly in the writer. Yet, the writer crashes.<br><br><br>void write_to_jpg(std::string filename, itk::Image&lt;unsigned char, 2&gt;::Pointer mask) <br>{<br>&nbsp;&nbsp;&nbsp; typedef itk::Image&lt;unsigned char, 2&gt; InputImageType, UCharImageType; <br>&nbsp;&nbsp;&nbsp; itk::ImageFileWriter&lt;UCharImageType&gt;::Pointer p_writer =
 itk::ImageFileWriter&lt;UCharImageType&gt;::New();<br>&nbsp;&nbsp;&nbsp; p_writer-&gt;SetFileName(filename);<br>&nbsp;&nbsp;&nbsp; p_writer-&gt;SetInput(mask);<br><br>&nbsp;&nbsp;&nbsp; itk::Image&lt;unsigned char, 2&gt;::PixelContainer * p_cont = mask-&gt;GetPixelContainer();<br>&nbsp;&nbsp;&nbsp; unsigned char const * p_image_data = p_cont-&gt;GetImportPointer();<br>&nbsp;&nbsp;&nbsp; for(int ii = 0; ii &lt; 10; ++ii)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(int jj = 0; jj &lt; 10; ++jj)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; ii &lt;&lt; ", " &lt;&lt; jj &lt;&lt; ", " &lt;&lt; int(p_image_data[ii*10+jj]) &lt;&lt; std::endl;<br><br>&nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p_writer-&gt;Update();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; catch(itk::ExceptionObject &amp; err)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 std::cout&lt;&lt;&nbsp; "Writer Update failed:"&lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br><br>Program crashes in :<br><br>std::list&lt;LightObject::Pointer&gt; allobjects =<br>&nbsp;&nbsp;&nbsp; ObjectFactoryBase::CreateAllInstance("itkImageIOBase");<br>&nbsp; for(std::list&lt;LightObject::Pointer&gt;::iterator i = allobjects.begin();<br><br><br>Thank you,<br>Emma<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> "insight-users-request@itk.org" &lt;insight-users-request@itk.org&gt;<br><b><span style="font-weight: bold;">To:</span></b> insight-users@itk.org<br><b><span style="font-weight: bold;">Sent:</span></b> Fri, July 16, 2010 9:00:33 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Insight-users Digest, Vol
 75, Issue 29<br></font><br>
Send Insight-users mailing list submissions to<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br><span>&nbsp;&nbsp;&nbsp; <a target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a></span><br>or, via email, send a message with subject or body 'help' to<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:insight-users-request@itk.org" href="mailto:insight-users-request@itk.org">insight-users-request@itk.org</a><br><br>You can reach the person managing the list at<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:insight-users-owner@itk.org" href="mailto:insight-users-owner@itk.org">insight-users-owner@itk.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Insight-users digest..."<br><br><br>Today's
 Topics:<br><br>&nbsp;  1. Re: Segmentation validation Curves, Spheres (Juan Cardelino)<br>&nbsp;  2. Re: building contour trees (Reda, Fitsum A)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Fri, 16 Jul 2010 11:13:13 -0300<br>From: Juan Cardelino &lt;<a ymailto="mailto:juan.cardelino@gmail.com" href="mailto:juan.cardelino@gmail.com">juan.cardelino@gmail.com</a>&gt;<br>Subject: Re: [Insight-users] Segmentation validation Curves, Spheres<br>To: elhadj meljane &lt;<a ymailto="mailto:elhadj.meljane@gmail.com" href="mailto:elhadj.meljane@gmail.com">elhadj.meljane@gmail.com</a>&gt;<br>Cc: ITK Users &lt;<a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;<a ymailto="mailto:AANLkTilymdEDPOg4y8Fz4CPPyL9O8AXzzymjgrfPLDWy@mail.gmail.com"
 href="mailto:AANLkTilymdEDPOg4y8Fz4CPPyL9O8AXzzymjgrfPLDWy@mail.gmail.com">AANLkTilymdEDPOg4y8Fz4CPPyL9O8AXzzymjgrfPLDWy@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=UTF-8<br><br>Hi elhadj,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; In the 2D case I know some works that, compare<br>segmentations, by either compare boundary maps or partitions. If your<br>ultimate goal is segmentation, I'm not sure if it is a good idea to<br>compare curves, I'd rather compare segmentations. Regarding boundary<br>comparison you can check the work of D. Martin at Berkeley, and a<br>benchmark system called Berkeley Segmentation Dataset or something<br>like that. Regarding the region based approach, you should check the<br>work of J. Cardoso, search for "Quantitative evaluation".<br>If you really want to compare curves, there's I know some work<br>comparing curves represented as distance maps, which compare them<br>modulo a rigid transformation.<br>I
 hope this helps.<br>Best regards,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Juan<br><br>On Wed, Jul 14, 2010 at 2:20 PM, elhadj meljane<br>&lt;<a ymailto="mailto:elhadj.meljane@gmail.com" href="mailto:elhadj.meljane@gmail.com">elhadj.meljane@gmail.com</a>&gt; wrote:<br>&gt; Hi all,<br>&gt; I'm looking for a tool to validate my segmentation results in 2D and 3D:<br>&gt; ??- 2D: I have manual and automatic segmented curves<br>&gt; ??- ?3D: I have a manual segmentation of a sphere-like structure and a<br>&gt; simulated sphere like structure<br>&gt;<br>&gt; I would like to know:<br>&gt;<br>&gt; -? Do I have to choose manually a set of points on the manual and automatic<br>&gt; ?? segmentation to compute a distance between the two sets (for example<br>&gt; ?? housdorff distance)?<br>&gt; - there is an itk tool (or a simplest way) that I can use it to validate the<br>&gt; segmentation?<br>&gt; ?? Thank you<br>&gt; ?? Sincerely,<br>&gt;
 H.<br>&gt; _____________________________________<br>&gt; Powered by <a target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>&gt;<br>&gt; Visit other Kitware open-source projects at<br><span>&gt; <a target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></span><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br><span>&gt; <a target="_blank" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a></span><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br><span>&gt; <a target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a></span><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users"
 target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>&gt;<br><br><br>------------------------------<br><br>Message: 2<br>Date: Fri, 16 Jul 2010 11:10:51 -0400<br>From: "Reda, Fitsum A" &lt;<a ymailto="mailto:fitecx@gmail.com" href="mailto:fitecx@gmail.com">fitecx@gmail.com</a>&gt;<br>Subject: Re: [Insight-users] building contour trees<br>To: Liam Kurmos &lt;<a ymailto="mailto:quantum.leaf@googlemail.com" href="mailto:quantum.leaf@googlemail.com">quantum.leaf@googlemail.com</a>&gt;,&nbsp;&nbsp;&nbsp; insight-users<br>&nbsp;&nbsp;&nbsp; &lt;<a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;<a ymailto="mailto:AANLkTin_6jaaUDcGcPs3Wgwhdvu5rQz8ogUZG8lViTUw@mail.gmail.com" href="mailto:AANLkTin_6jaaUDcGcPs3Wgwhdvu5rQz8ogUZG8lViTUw@mail.gmail.com">AANLkTin_6jaaUDcGcPs3Wgwhdvu5rQz8ogUZG8lViTUw@mail.gmail.com</a>&gt;<br>Content-Type:
 text/plain; charset=ISO-8859-1<br><br>On 7/13/10, Liam Kurmos &lt;<a ymailto="mailto:quantum.leaf@googlemail.com" href="mailto:quantum.leaf@googlemail.com">quantum.leaf@googlemail.com</a>&gt; wrote:<br>&gt; Hi All,<br>&gt;<br>&gt; I'm wondering if anyone has experience of building Contour Trees (such<br><span>&gt; as per <a target="_blank" href="http://citeseer.ist.psu.edu/carr99computing.html">http://citeseer.ist.psu.edu/carr99computing.html</a> ) from volume</span><br>&gt; data? and if so whether there are any open source libraries for tree<br>&gt; construction? I have looked at libtourtre<br><span>&gt; <a target="_blank" href="http://graphics.cs.ucdavis.edu/%7Esdillard/libtourtre/doc/html/">http://graphics.cs.ucdavis.edu/~sdillard/libtourtre/doc/html/</a> but so</span><br>&gt; far not had much success with getting it to work.<br>&gt;<br>&gt; If anyone has any information of how to do it, please let me know.<br>&gt;<br>&gt; Liam<br>&gt;
 _____________________________________<br><span>&gt; Powered by <a target="_blank" href="http://www.kitware.com">www.kitware.com</a></span><br>&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br><br>-- <br>Sent from my mobile
 device<br><br><br>------------------------------<br><br>_______________________________________________<br>Insight-users mailing list<br><a ymailto="mailto:Insight-users@itk.org" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><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>End of Insight-users Digest, Vol 75, Issue 29<br>*********************************************<br></div></div>
</div><br>

      </body></html>