Hello dear list,

I recently attended the presentation of MITK in Aachen and am now trying
to write my first MITK plugin. :)

The plugin is supposed to plot the average greyscale value of selected
regions in an animated image (ultrasonic scan) using ExtApp. But how do
I actually access the ROIs?

I tried to find something useful in the documentation, but ended up
confused. The only "documentation" I could find showed the
implementation of methods of classes which had the world "Slice" in
them.
Can someone point me into the right direction how to read the pixel
values out of ROIs per frame in an animation?

Thanks a lot for your help in advance!
Stefan

P.S.: I'm currently attempting this:

void QmitkContrastAnalyzerMITKPluginView ::
OnSelectionChanged(std::vector<mitk::DataNode*> nodes)
{
        greyscaleData.clear(); // std::vector<float>, compute greyscale value
from 0.0 to 1.0 for ROI in each frame

/*      // dummy data for plotting, works. how to replace this with real
data?
        greyscaleData.reserve(10);
        for(unsigned i = 0; i < greyscaleData.capacity(); ++i)
                greyscaleData.push_back(static_cast<float>(i) /
greyscaleData.capacity());
*/

        // here i'm attempting to find a node with segmentation data
        for(std::vector<mitk::DataNode*>::const_iterator node = nodes.begin();
node != nodes.end(); ++node)
        {
                MITK_INFO << "stefan: parsing " << (*node)->GetName();
                if(!*node)
                {
                        MITK_INFO << "stefan: not a node";
                        continue;
                }

                const mitk::BaseData* data = (*node)->GetData();
                if(!data)
                {
                        MITK_INFO << "stefan: no data in node";
                        continue;
                }

                bool isSegmentation = false;
                (*node)->GetBoolProperty("segmentation", isSegmentation);
                if(!isSegmentation)
                {
                        MITK_INFO << "stefan: no segmentation data in node";
                        continue;
                }

                mitk::Image* segmentationImage =
dynamic_cast<mitk::Image*>((*node)->GetData());
                if(!segmentationImage)
                {
                        MITK_INFO << "stefan: segmentation data cast to image 
failed";
                        continue;
                }

                MITK_INFO << "stefan: prospecting " <<
segmentationImage->GetDimension() << "D segmentation " <<
(*node)->GetName();

/********** now how to get the pixel values out of the ROIS? *******/
        }

        // tells the graph plotting widget which data to plot
        graphWidget->setData(greyscaleData);
}



An example DICOM image shows this information in ExtApp:
Image (0xaa4f628)

PixelType: s
BitsPerElement: 16
NumberOfComponents: 1
BitsPerComponent: 16
Dimension: 3
Dimensions: 800 600 381 
TimeSlicedGeometry: TimeSlicedGeometry (0xaa3bfa0)
EvenlyTimed: 1
TimeSteps: 1
GetGeometry3D(0): SlicedGeometry3D (0xaa5c370)
IndexToWorldTransform: 
Matrix: 
1 0 0 
0 1 0 
0 0 1 
Offset: [0, 0, 0]
Center: [0, 0, 0]
Translation: [0, 0, 0]
Inverse: 
1 0 0 
0 1 0 
0 0 1 
Scale : 1 1 1 
BoundingBox: ( 0,800 0,600 0,381 )
Origin: [0, 0, 0]
ImageGeometry: 1
Spacing: [1, 1, 1]
TimeBounds: [-3.40282e+38, 3.40282e+38]
EvenlySpaced: 1
DirectionVector: [0, 0, 1]
Slices: 381
GetGeometry2D(0): PlaneGeometry (0xaa3b2c0)
IndexToWorldTransform: 
Matrix: 
1 0 0 
0 1 0 
0 0 1 
Offset: [0, 0, 0]
Center: [0, 0, 0]
Translation: [0, 0, 0]
Inverse: 
1 0 0 
0 1 0 
0 0 1 
Scale : 1 1 1 
BoundingBox: ( 0,800 0,600 0,1 )
Origin: [0, 0, 0]
ImageGeometry: 1
Spacing: [1, 1, 1]
TimeBounds: [-3.40282e+38, 3.40282e+38]
ScaleFactorMMPerUnitX: 1
ScaleFactorMMPerUnitY: 1
Normal: [0, 0, 1]



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to