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 "itkConfidenceConnectedImageFilter.h"<br>
<br>
<br>
<br>
#include "itkImage.h"<br>
#include "itkCastImageFilter.h"<br>
<br>
<br>
<br>
#include "itkCurvatureFlowImageFilter.h"<br>
<br>
<br>
<br>
#include "itkImageFileReader.h"<br>
#include "itkImageFileWriter.h"<br>
<br>
<br>
int main( int argc, char *argv[] )<br>
{<br>
if( argc < 5 )<br>
{<br>
std::cerr << "Missing Parameters " << std::endl;<br>
std::cerr << "Usage: " << argv[0];<br>
std::cerr << " inputImage outputImage
seedX1 seedY1 seedZ1 seedX2 seedY2 seedZ2 seedX3 seedY3 seedZ3 seedX4
seedY4 seedZ4 seedX5 seedY5 seedZ5 " << std::endl;<br>
return 1;<br>
}<br>
<br>
<br>
<br>
typedef float InternalPixelType;<br>
const unsigned int Dimension = 3;<br>
typedef itk::Image< InternalPixelType, Dimension > InternalImageType;<br>
<br>
<br>
typedef unsigned char OutputPixelType;<br>
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<br>
<br>
typedef itk::CastImageFilter< InternalImageType, OutputImageType ><br>
CastingFilterType;<br>
CastingFilterType::Pointer caster = CastingFilterType::New();<br>
<br>
<br>
<br>
typedef itk::ImageFileReader< InternalImageType > ReaderType;<br>
typedef itk::ImageFileWriter< OutputImageType > WriterType;<br>
<br>
ReaderType::Pointer reader = ReaderType::New();<br>
WriterType::Pointer writer = WriterType::New();<br>
<br>
reader->SetFileName( argv[1] );<br>
writer->SetFileName( argv[2] );<br>
<br>
<br>
<br>
typedef itk::CurvatureFlowImageFilter< InternalImageType, InternalImageType ><br>
CurvatureFlowImageFilterType;<br>
<br>
CurvatureFlowImageFilterType::Pointer smoothing = <br>
CurvatureFlowImageFilterType::New();<br>
<br>
typedef itk::ConfidenceConnectedImageFilter<InternalImageType, InternalImageType> <br>
ConnectedFilterType;<br>
<br>
ConnectedFilterType::Pointer confidenceConnected = ConnectedFilterType::New();<br>
<br>
smoothing->SetInput( reader->GetOutput() );<br>
confidenceConnected->SetInput( smoothing->GetOutput() );<br>
caster->SetInput( confidenceConnected->GetOutput() );<br>
writer->SetInput( caster->GetOutput() );<br>
<br>
smoothing->SetNumberOfIterations( 5 );<br>
smoothing->SetTimeStep( 0.05 );<br>
<br>
confidenceConnected->SetMultiplier( 2.5 );<br>
<br>
confidenceConnected->SetNumberOfIterations( 5 );<br>
<br>
confidenceConnected->SetReplaceValue( 255 );<br>
<br>
<br>
<br>
InternalImageType::IndexType indexSeed1;<br>
<br>
indexSeed1[0] = atoi( argv[3] );<br>
indexSeed1[1] = atoi( argv[4] );<br>
<br>
InternalImageType::IndexType indexSeed2;<br>
<br>
indexSeed2[0] = atoi( argv[5] );<br>
indexSeed2[1] = atoi( argv[6] );<br>
<br>
<br>
InternalImageType::IndexType indexSeed3;<br>
<br>
indexSeed3[0] = atoi( argv[7] );<br>
indexSeed4[1] = atoi( argv[8] );<br>
<br>
<br>
InternalImageType::IndexType indexSeed4;<br>
<br>
indexSeed4[0] = atoi( argv[9] );<br>
indexSeed4[1] = atoi( argv[10] );<br>
<br>
<br>
InternalImageType::IndexType indexSeed5;<br>
<br>
indexSeed5[0] = atoi( argv[11] );<br>
indexSeed5[1] = atoi( argv[12] );<br>
<br>
<br>
confidenceConnected->SetSeed1( indexSeed1 );<br>
confidenceConnected>SetSeed2( indexSeed2 );<br>
confidenceConnected->SetSeed3( indexSeed3 );<br>
confidenceConnected>SetSeed4( indexSeed4 );<br>
confidenceConnected->SetSeed5( indexSeed5 );<br>
<br>
<br>
<br>
try<br>
{<br>
writer->Update();<br>
}<br>
catch( itk::ExceptionObject & excep )<br>
{<br>
std::cerr << "Exception caught !" << std::endl;<br>
std::cerr << excep << std::endl;<br>
}<br>
<br>
<br>
return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>