hi all<br>
<br>
i am workin on a series of dicom images for segmentation. i converted
the series to analyze format using the mricro image converter option.
as i want to work on 3D image segmentation<br>
<br>
question <br>
<br>
1- after converting the series into analyze formay are they now in 3D format images<br>
2-i tried the application of confidence connected 3d imagesegmentaiton
but it doesnt works. i am getting messages like the seed is not a
member; indeclared identifier..<br>
i am sending the modified code.<br>
3- on the example in the itk software guide it uses 5 seed points with
3 coordinates. how can i see the third coordinate of my image ( example
in MRIcro)<br>
<br>
<br>
#include &quot;itkConfidenceConnectedImageFilter.h&quot;<br>
<br>
<br>
<br>
#include &quot;itkImage.h&quot;<br>
#include &quot;itkCastImageFilter.h&quot;<br>
<br>
<br>
<br>
#include &quot;itkCurvatureFlowImageFilter.h&quot;<br>
<br>
<br>
<br>
#include &quot;itkImageFileReader.h&quot;<br>
#include &quot;itkImageFileWriter.h&quot;<br>
<br>
<br>
int main( int argc, char *argv[] )<br>
{<br>
&nbsp; if( argc &lt; 5 )<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Missing Parameters &quot; &lt;&lt; std::endl;<br>
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];<br>
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot; inputImage&nbsp; outputImage
seedX1 seedY1 seedZ1 seedX2 seedY2 seedZ2 seedX3 seedY3 seedZ3 seedX4
seedY4 seedZ4 seedX5 seedY5 seedZ5 &quot; &lt;&lt; std::endl;<br>
&nbsp;&nbsp;&nbsp; return 1;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
<br>
&nbsp; <br>
&nbsp; typedef&nbsp;&nbsp; float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalPixelType;<br>
&nbsp; const&nbsp;&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp; Dimension = 3;<br>
&nbsp; typedef itk::Image&lt; InternalPixelType, Dimension &gt;&nbsp; InternalImageType;<br>
<br>
<br>
&nbsp; typedef unsigned char OutputPixelType;<br>
&nbsp; typedef itk::Image&lt; OutputPixelType, Dimension &gt; OutputImageType;<br>
<br>
&nbsp; typedef itk::CastImageFilter&lt; InternalImageType, OutputImageType &gt;<br>
&nbsp;&nbsp;&nbsp; CastingFilterType;<br>
&nbsp; CastingFilterType::Pointer caster = CastingFilterType::New();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<br>
<br>
&nbsp; typedef&nbsp; itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;<br>
&nbsp; typedef&nbsp; itk::ImageFileWriter&lt;&nbsp; OutputImageType&nbsp; &gt; WriterType;<br>
<br>
&nbsp; ReaderType::Pointer reader = ReaderType::New();<br>
&nbsp; WriterType::Pointer writer = WriterType::New();<br>
<br>
&nbsp; reader-&gt;SetFileName( argv[1] );<br>
&nbsp; writer-&gt;SetFileName( argv[2] );<br>
<br>
<br>
&nbsp;<br>
&nbsp; typedef itk::CurvatureFlowImageFilter&lt; InternalImageType, InternalImageType &gt;<br>
&nbsp;&nbsp;&nbsp; CurvatureFlowImageFilterType;<br>
&nbsp;<br>
&nbsp; CurvatureFlowImageFilterType::Pointer smoothing = <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CurvatureFlowImageFilterType::New();<br>
&nbsp;<br>
&nbsp; typedef itk::ConfidenceConnectedImageFilter&lt;InternalImageType, InternalImageType&gt; <br>
&nbsp;&nbsp;&nbsp; ConnectedFilterType;<br>
&nbsp; <br>
&nbsp; ConnectedFilterType::Pointer confidenceConnected = ConnectedFilterType::New();<br>
<br>
&nbsp; smoothing-&gt;SetInput( reader-&gt;GetOutput() );<br>
&nbsp; confidenceConnected-&gt;SetInput( smoothing-&gt;GetOutput() );<br>
&nbsp; caster-&gt;SetInput( confidenceConnected-&gt;GetOutput() );<br>
&nbsp; writer-&gt;SetInput( caster-&gt;GetOutput() );<br>
&nbsp;<br>
&nbsp; smoothing-&gt;SetNumberOfIterations( 5 );<br>
&nbsp; smoothing-&gt;SetTimeStep( 0.05 );<br>
<br>
&nbsp; confidenceConnected-&gt;SetMultiplier( 2.5 );<br>
<br>
&nbsp; confidenceConnected-&gt;SetNumberOfIterations( 5 );<br>
<br>
&nbsp; confidenceConnected-&gt;SetReplaceValue( 255 );<br>
<br>
<br>
&nbsp; <br>
&nbsp; InternalImageType::IndexType&nbsp; indexSeed1;<br>
&nbsp; <br>
&nbsp; indexSeed1[0] = atoi( argv[3] );<br>
&nbsp; indexSeed1[1] = atoi( argv[4] );<br>
<br>
&nbsp; InternalImageType::IndexType&nbsp; indexSeed2;<br>
&nbsp; <br>
&nbsp; indexSeed2[0] = atoi( argv[5] );<br>
&nbsp; indexSeed2[1] = atoi( argv[6] );<br>
<br>
&nbsp; <br>
&nbsp; InternalImageType::IndexType&nbsp; indexSeed3;<br>
&nbsp; <br>
&nbsp; indexSeed3[0] = atoi( argv[7] );<br>
&nbsp; indexSeed4[1] = atoi( argv[8] );<br>
<br>
<br>
&nbsp; InternalImageType::IndexType&nbsp; indexSeed4;<br>
&nbsp; <br>
&nbsp; indexSeed4[0] = atoi( argv[9] );<br>
&nbsp; indexSeed4[1] = atoi( argv[10] );<br>
<br>
&nbsp; <br>
&nbsp; InternalImageType::IndexType&nbsp; indexSeed5;<br>
&nbsp; <br>
&nbsp; indexSeed5[0] = atoi( argv[11] );<br>
&nbsp; indexSeed5[1] = atoi( argv[12] );<br>
<br>
<br>
&nbsp;confidenceConnected-&gt;SetSeed1( indexSeed1 );<br>
&nbsp;confidenceConnected&gt;SetSeed2( indexSeed2 );<br>
&nbsp;confidenceConnected-&gt;SetSeed3( indexSeed3 );<br>
&nbsp;confidenceConnected&gt;SetSeed4( indexSeed4 );<br>
&nbsp;confidenceConnected-&gt;SetSeed5( indexSeed5 );<br>
<br>
&nbsp;<br>
<br>
&nbsp; try<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; writer-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp; catch( itk::ExceptionObject &amp; excep )<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Exception caught !&quot; &lt;&lt; std::endl;<br>
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; excep &lt;&lt; std::endl;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;<br>
<br>
&nbsp; return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>