Hi,

I want to write some 3D data over time into a mitk::Image.
What I do is the following:

void MyImageData::Initialize(mitk::Image::Pointer image, int nrOfVolumes)
{
        unsigned int *d = image->GetDimensions();
        d[3] = nrOfVolumes;

        imageSeries = mitk::Image::New();
        imageSeries->Initialize(image->GetPixelType(), 4,d,1);

        initialized = true;
}

bool MyImageData::pushDataBack(mitk::Image::Pointer image)
{
        if (initialized)
        {
                imageSeries->SetImportVolume(image, time);
                imageSeries->GetData();
                imageSeries->Update();

                if(imageSeries->IsVolumeSet(time))
                {
                        time++;
                        return true;
                }
                return false;
        }
        else
                return false;

}

It works fine for the first image. After that I get exceptions in the  
memory management. I tried all variants of  
mitk::Image::ImportMemoryManagementType in the SetImportVolume-function.
As I understand the concept of mitk::Image I can save data with the  
same region and data type over time just by increasing the time  
variable, right?
Can anyone help me, please?

Best regards,
Claudia


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to