<div dir="ltr"><div>Ok the .mhd way to do this worked great.<br><br></div><div>I have to do 3D segmentation on raw images. I tryed to do this with the ThresholdImageFilter but all my values are at zero after applying the filter ...<br>
</div><div>My Raw images are Float32 3D 128x128x128, here is my code :<br><br>import org.itk.simple.ConnectedThresholdImageFilter;<br>import org.itk.simple.Image;<br>import org.itk.simple.ImageFileReader;<br>import org.itk.simple.ImageFileWriter;<br>
import org.itk.simple.VectorUInt32;<br><br>public class ImageReader {<br><br>    private static String inputFilename = &quot;fdk.xy.mhd&quot;;<br>    private static String outputFilename = &quot;output.mhd&quot;;<br><br>    public static void main(String[] args) {<br>
<br>        VectorUInt32 seedList = new VectorUInt32(3);<br>        ImageFileReader reader = new ImageFileReader();<br>        ImageFileWriter writer = new ImageFileWriter();<br>        ConnectedThresholdImageFilter filter = new ConnectedThresholdImageFilter();<br>
<br>        reader.setFileName(inputFilename);<br>        writer.setFileName(outputFilename);<br><br>        Image input = reader.execute();<br><br>        /* valeurs de seuil */<br>        filter.setLower(0.003);<br>        filter.setUpper(5);<br>
        filter.setReplaceValue((short) 5);<br><br>        /* seed points */<br>        seedList.clear();<br>        seedList.push_back(100);<br>        seedList.push_back(16);<br>        seedList.push_back(46);<br><br><br>
        Image output = filter.execute(input);<br>        writer.execute(output);<br><br>    }<br><br></div><div>Do you know how to make it work?<br><br></div><div>Thank you !<br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">2013/4/26 Samuel Pichardo <span dir="ltr">&lt;<a href="mailto:sammeuly@gmail.com" target="_blank">sammeuly@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi<div><br></div><div>In Python, you could use rather numpy io function </div><div><a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromfile.html" target="_blank">http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromfile.html</a></div>
<div>and convert the arrays to simpleITK with </div><div><h3 style="text-align:left;color:rgb(34,34,34);text-overflow:ellipsis;overflow:hidden;font-size:medium;white-space:nowrap;font-family:arial,sans-serif;margin:0px;font-weight:normal;padding:0px">
<a href="http://www.nullege.com/codes/search/SimpleITK.GetImageFromArray" style="color:rgb(17,34,204)" target="_blank"><em style="font-weight:bold;font-style:normal">SimpleITK</em>.<em style="font-weight:bold;font-style:normal">GetImageFromArray</em></a></h3>
<div><br></div></div><div>Regards</div><div><br></div><div>Sam</div><div><br></div><div><br></div><div><div><div><div class="h5"><div>On 2013-04-26, at 4:59 AM, Thibault Varacca &lt;<a href="mailto:thibault.varacca@gmail.com" target="_blank">thibault.varacca@gmail.com</a>&gt; wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr"><div><div><div>Dear all, <br></div>I&#39;m looking to load and read raw images with simpleITK but I didn&#39;t find any RawReader(). <br></div>How can i do this?<br>
</div>Thanks !<br clear="all"><div>
<div><br>-- <br>Thibault Varacca<br>EFREI Promo 2014<br><div>06 60 53 11 35</div>
</div></div></div></div></div><div class="im">
_____________________________________<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.php" target="_blank">http://www.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-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Thibault Varacca<br>EFREI Promo 2014<br><div>06 60 53 11 35</div>
</div>