Page MenuHomePhabricator

unsigned long 2D images cause problems
Closed, WontfixPublic

Description

In the code create an unsigned long 2D itk image and put it in a datanode.
MITK will crash.

Example code:

#include <mitkImageCast.h>

typedef itk::Image<unsigned long, 2> ImageTypeUL2D;

// Create a new ITK image   
ImageTypeUL2D::Pointer outputImage = ImageTypeUL2D::New();
ImageTypeUL2D::RegionType myRegion;
ImageTypeUL2D::SizeType mySize;
ImageTypeUL2D::IndexType myIndex;
ImageTypeUL2D::SpacingType mySpacing;
mySpacing[0] = 1;
mySpacing[1] = 1;
myIndex[0] = 0;
myIndex[1] = 0;
mySize[0] = 100;
mySize[1] = 100;
myRegion.SetSize( mySize);
myRegion.SetIndex( myIndex );
outputImage->SetSpacing(mySpacing);
outputImage->SetRegions( myRegion);
outputImage->Allocate();
outputImage->FillBuffer(0);

// cast to mitk
mitk::Image::Pointer output
mitk::CastToMitkImage(outputImage, output)

// put to datanode

mitk::DataNode::Pointer node = mitk::DataNode::New();
node->SetData( output );
m_DataStorage->Add(node);

Event Timeline

kislinsk claimed this task.
kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.