[Insight-users] ShapeModelCalculator

Ilaria Canova Calori canovaca at stud.ntnu.no
Wed Jan 19 07:39:08 EST 2005


Dear All,

I have to segment the aortic aneurysm in CTscans and I would like to
make a model of the shape for it. I am trying to use
itkActiveShapeModelCalculator, I wrote just a simple program to test
it:
-----------------------------------------------------------------
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkActiveShapeModelCalculator.h"
#include "itkActiveShapeModelCalculator.txx"

int main( int argc, char * argv[] )
{
   if( argc < 2 )
     {
     std::cerr << "Usage: " << argv[0];
     std::cerr << " inputFile "<< std::endl;
     return 1;
     }

   typedef unsigned char InputPixelType;
   typedef unsigned char   OutputPixelType;

   typedef itk::Image< InputPixelType,3 > VolumeImageType;
   typedef itk::Image<InputPixelType,2> ImageType;
   typedef itk::Image<OutputPixelType,2> OutputImageType;

   typedef itk::ImageFileReader< VolumeImageType  >  ReaderType;
   ReaderType::Pointer reader = ReaderType::New();

   VolumeImageType::ConstPointer inputImage;

   reader->SetFileName( argv[1] );
   inputImage = reader->GetOutput();
   reader->Update();

   typedef itk::ActiveShapeModelCalculator< VolumeImageType >
ActiveShapeModelCalculatorType;
   ActiveShapeModelCalculatorType::Pointer asmFilter =
ActiveShapeModelCalculatorType::New();

   asmFilter->SetImage(inputImage);
   asmFilter->GenerateData();

   std::cout << "The number of training images are: " <<
    asmFilter->GetNumberOfTrainingImages() << std::endl;

   std::cout << "The mean shape: " <<
    asmFilter->GetMeanShape() << std::endl;


   return 0;
}
--------------------------------------------------------------------
I can built it but when I run it, it always encounters a problem and
needs to close. Is there anything I made wrong?

Thanks in advance,
Ilaria Canova Calori
--



More information about the Insight-users mailing list