[Insight-users] confidence connected applicaiton question

ilker hacıhaliloğlu hacihaliloglu at gmail.com
Wed Nov 2 14:24:15 EST 2005


hi all

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

question

1- after converting the series into analyze formay are they now in 3D format
images
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..
i am sending the modified code.
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)


#include "itkConfidenceConnectedImageFilter.h"



#include "itkImage.h"
#include "itkCastImageFilter.h"



#include "itkCurvatureFlowImageFilter.h"



#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"


int main( int argc, char *argv[] )
{
if( argc < 5 )
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImage outputImage seedX1 seedY1 seedZ1 seedX2 seedY2
seedZ2 seedX3 seedY3 seedZ3 seedX4 seedY4 seedZ4 seedX5 seedY5 seedZ5 " <<
std::endl;
return 1;
}



typedef float InternalPixelType;
const unsigned int Dimension = 3;
typedef itk::Image< InternalPixelType, Dimension > InternalImageType;


typedef unsigned char OutputPixelType;
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;

typedef itk::CastImageFilter< InternalImageType, OutputImageType >
CastingFilterType;
CastingFilterType::Pointer caster = CastingFilterType::New();



typedef itk::ImageFileReader< InternalImageType > ReaderType;
typedef itk::ImageFileWriter< OutputImageType > WriterType;

ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();

reader->SetFileName( argv[1] );
writer->SetFileName( argv[2] );



typedef itk::CurvatureFlowImageFilter< InternalImageType, InternalImageType
>
CurvatureFlowImageFilterType;

CurvatureFlowImageFilterType::Pointer smoothing =
CurvatureFlowImageFilterType::New();

typedef itk::ConfidenceConnectedImageFilter<InternalImageType,
InternalImageType>
ConnectedFilterType;

ConnectedFilterType::Pointer confidenceConnected =
ConnectedFilterType::New();

smoothing->SetInput( reader->GetOutput() );
confidenceConnected->SetInput( smoothing->GetOutput() );
caster->SetInput( confidenceConnected->GetOutput() );
writer->SetInput( caster->GetOutput() );

smoothing->SetNumberOfIterations( 5 );
smoothing->SetTimeStep( 0.05 );

confidenceConnected->SetMultiplier( 2.5 );

confidenceConnected->SetNumberOfIterations( 5 );

confidenceConnected->SetReplaceValue( 255 );



InternalImageType::IndexType indexSeed1;

indexSeed1[0] = atoi( argv[3] );
indexSeed1[1] = atoi( argv[4] );

InternalImageType::IndexType indexSeed2;

indexSeed2[0] = atoi( argv[5] );
indexSeed2[1] = atoi( argv[6] );


InternalImageType::IndexType indexSeed3;

indexSeed3[0] = atoi( argv[7] );
indexSeed4[1] = atoi( argv[8] );


InternalImageType::IndexType indexSeed4;

indexSeed4[0] = atoi( argv[9] );
indexSeed4[1] = atoi( argv[10] );


InternalImageType::IndexType indexSeed5;

indexSeed5[0] = atoi( argv[11] );
indexSeed5[1] = atoi( argv[12] );


confidenceConnected->SetSeed1( indexSeed1 );
confidenceConnected>SetSeed2( indexSeed2 );
confidenceConnected->SetSeed3( indexSeed3 );
confidenceConnected>SetSeed4( indexSeed4 );
confidenceConnected->SetSeed5( indexSeed5 );



try
{
writer->Update();
}
catch( itk::ExceptionObject & excep )
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << excep << std::endl;
}


return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051102/b2da6626/attachment.htm


More information about the Insight-users mailing list