Beispiel #1
0
bool MiaDistanceTransformFromCenterline::reAllocOutputImage()
{
    if(outputImage)
        outputImage->release();
    if(workingMode == MIA_ReadAllKeyValues)
        outputImage = creatEmptyImageFrom(inputImage, IM_RGBA);
    else
        outputImage = creatEmptyImageFrom(inputImage, IM_float);

    if(outputImage)
    {
        outputImage->retain();
        float* sp = outputImage->getSpacing();
        int* si = outputImage->getDimSize();
        float minSpacing = MAX_FLOAT;
        for(int i = 0; i<3; i++)
        {
            if(sp[i] < minSpacing)
                minSpacing = sp[i];
        }
        for(int i = 0; i<3; i++)
        {
            spacing[i] = sp[i]/minSpacing;
            size[i] = si[i];
        }
        outData = (float*) outputImage->getDataPtr();
        return true;
    }
    else
        return false;
}
Beispiel #2
0
bool MiaImageForestingTransform::reAllocOutputImage()
{
    if(outputImage)
    {
        outputImage->release();
    }
    if(operateInSitu)
    {
        outputImage = inputImage;
    }
    else
    {
        outputImage = creatEmptyImageFrom( inputImage, IM_float);
    }

    if(outputImage)
    {
        outputImage->retain();
        if(tagMap)
            tagMap->release();
        tagMap = creatEmptyImageFrom(inputImage,IM_uchar);

        if(tagMap)
        {
            tagMap->retain();
        }
        else
            return false;

    }
    else
        return false;
    int* size = outputImage->getDimSize();
    float* sp = outputImage->getSpacing();
    imageWidth = size[0];
    imageHeight = size[1];
    imageDepth = size[2];
    float minSpacing = MAX_FLOAT;
    for(int i = 0; i<3; i++)
    {
        imageSize[i] = size[i];

        if(sp[i] < minSpacing)
            minSpacing = sp[i];
    }
    for(int i = 0; i<3; i++)
    {
        spacing[i] = sp[i]/minSpacing;
    }
    sliceSize = imageWidth*imageHeight;
    dimOffset[0] = 1;
    dimOffset[1] = imageWidth;
    dimOffset[2] = sliceSize;
    return true;
//    needReinitialize = false;
}
Beispiel #3
0
bool MiaPersistantLabel::reAllocOutputImage()
{
    if(outputImage)
    {
        outputImage->release();
    }
    outputImage = creatEmptyImageFrom( inputImage, IM_uchar);
    if(outputImage)
    {
        outputImage->retain();
        reset();

    }
    else
        return false;

    return true;
}
Beispiel #4
0
bool MiaZeroCrossingFilter::reAllocOutputImage()
{
    if(outputImage)
    {
        outputImage->release();
    }
    if(operateInSitu && inputImage->getType()==IM_float)
        outputImage = inputImage;
    else
        outputImage = creatEmptyImageFrom( inputImage, IM_float);
    if(outputImage)
    {
        outputImage->retain();

    }
    else
        return false;

    return true;
}