[Insight-users] How to Define a Global Itk::Image?

David Doria daviddoria at gmail.com
Thu Jan 13 10:18:01 EST 2011


On Thu, Jan 13, 2011 at 10:14 AM, Ali Habib <ali.mahmoud.habib at gmail.com> wrote:
> Hi i am trying to define a global itk::Image and then set it's image in a
> function so that i'll be able to use it when required , but the fact is when
> i try to reuse it it seems corrupted , I wanna know how to do something like
> that in objective c..
> thanks

How are you setting it? I don't see why this wouldn't work?

typedef itk::Image<unsigned char, 2> ImageType;

ImageType::Pointer myImage;

int main()
{
SomeFunction()
AnotherFunction()
}

void SomeFunction()
{
myImage = ImageType::New();
// setup image here
}

void AnotherFunction()
{
access myImage here
}

David


More information about the Insight-users mailing list