[Insight-users] Problem using itk::Image

Kent Ogden ogdenk at upstate.edu
Tue Mar 4 14:34:46 EST 2014


All,
 
I am trying to do something simple that is not working, I think this may be very simple but I'm stuck at the moment.  I would like to create an itk::Image to store the results of a segmentation, so that I can change the seed point and re-run the segmentation without losing the initial results.  I am using the DeepCopy example to create a copy of the segmentation filter output, this seems to work OK.
 
I run into problems when I try to use that image as input to a quickview object.  A modified version of the Quickview demo will illustrate the problem:
 
#include "QuickView.h"
int main(int argc, char *argv[])
{
  typedef itk::Image< short, 2>  ImageType;
 
  typedef itk::ImageFileReader<ImageType> ReaderType;
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName("d:\\CTChest.dcm");
 
  ImageType::Pointer image = reader->GetOutput();
 
  QuickView viewer;
  viewer.AddImage(image);
  viewer.Visualize();
 
  return EXIT_SUCCESS;
}
 
This will not compile, the error is at the viewer.AddImage() line and says
 
"could not deduce template argument for 'TImage *' from 'itk::SmartPointer<TObjectType>'
 
Can someone explain this to me, and is there a way around this?  Thanks . . .
 
Kent
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140304/f31a4d95/attachment.html>


More information about the Insight-users mailing list