[ITK Community] Applying ITK script to many input images

Annabelle Dupuis dupuis.annabelle at yahoo.fr
Fri Feb 28 10:10:53 EST 2014


Hi ITK community,

I would like to apply my ITK filter to a serie of slices of an MRI and get as much outputs in the same directory (for instance).

How can I do it?
int main(int argc, char * argv[])
{
  // Verify command line arguments
  if( argc < N MRI IMAGES )
    {
    std::cerr << "Usage: " << std::endl;
    std::cerr << argv[0] << " InputImageFile " << std::endl;
    return EXIT_FAILURE;
    }


[SCRIPT AND FILTERS]
typedef itk::Image< unsigned char, 2 > WritingImage;
 typedef itk::ImageFileWriter<WritingImage>  WriterType;
  

  WriterType::Pointer writer = WriterType::New();
  std::string outputFilename = argv[NUMBER OF INPUTS];
  writer->SetFileName(outputFilename);
  writer->SetInput(imageTemp);
  writer->Update();


THANKS GUYS
Annabelle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140228/74140ff6/attachment-0002.html>


More information about the Community mailing list