[Insight-users] itkImageMaskSpatialObject segmentation fault

Bill Lorensen bill.lorensen at gmail.com
Thu Jun 27 16:37:08 EDT 2013


You should put a try/catch around reader->Update(). It may provide for
information.

http://itk.org/Wiki/ITK/Examples/SimpleOperations/TryCatch



On Thu, Jun 27, 2013 at 4:25 PM, Paolo Zaffino <p.zaffino at yahoo.it> wrote:

> Dear ITK community,
> I'm facing a strange ITK behavior.
> I wrote this code:
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageMaskSpatialObject.h"
>
> int main( int argc, char **argv )
> {
>   typedef itk::Image<unsigned char,3> ImageType;
>   typedef itk::ImageFileReader<**ImageType> ReaderType;
>
>   typedef itk::ImageMaskSpatialObject<3> MaskImageType;
>   typedef MaskImageType::Pointer MaskTypePointer;
>
>   ReaderType::Pointer reader = ReaderType::New();
>
>   reader->SetFileName( argv[1] );
>   reader->Update();
>
>   MaskTypePointer mask = MaskImageType::New();
>   mask->SetImage(reader->**GetOutput());
>
>   return 0;
> }
>
> and it compiles without error.
> When I try to run the executable I get a segmentation error (core dumped).
> What's is wrong?
> I'm using ITK 3.20.1 on a 64 bit Linux box.
> If needed I can provide the mask image.
>
> Thanks a lot for your help.
> Best regards.
> Paolo
> ______________________________**_______
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/**opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/**products/protraining.php<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 <http://www.itk.org/Wiki/ITK_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/**listinfo/insight-users<http://www.itk.org/mailman/listinfo/insight-users>
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130627/a796ea28/attachment.htm>


More information about the Insight-users mailing list