[ITK Community] [Insight-users] Problem using itk::Image

Bill Lorensen bill.lorensen at gmail.com
Tue Mar 4 15:29:23 EST 2014


Try
viewer.AddImage(image.GetPointer());

On Tue, Mar 4, 2014 at 2:34 PM, Kent Ogden <ogdenk at upstate.edu> wrote:
> 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
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
Unpaid intern in BillsBasement at noware dot com
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users



More information about the Community mailing list