Hey Tobias,
thank you for your quick answer! I will try your method and reply again as soon
as it works.
Best
Hannes
Von: Stein, Tobias <t.st...@dkfz-heidelberg.de>
Gesendet: Sonntag, 13. Mai 2018 15:04
An: hannes.bene...@gmx.de
Cc: mitk-users@lists.sourceforge.net
Betreff: AW: [mitk-users] Points from segmentation
Hey Hannes,
to answer your question, yes there is a way! You can access the DataStorage
which is the data structure of the DataManager-Plugin
<http://docs.mitk.org/2016.11/DataManagementPage.html> .
To do your pca you can get the points from the image data stored in a
mitk::Node within mitk::DataStorage.
To access the current data storage in your plugin you can use
mitk::DataStorage::Pointer ds = this->
<http://docs.mitk.org/2016.11/mitkMeshMitkLoader_8cpp.html#a4ca6c225b27b9863edd3c6316afae75b>
GetDataStorage();
Get your node with any of the getter methods like ds->getNamedNode()
Then you have to cast the result from mitk::DataNode::GetData() to a mitk image.
Now you can access the raw image data
<http://docs.mitk.org/2016.11/MitkImagePage.html#MitkImagePage_AccessImageData>
with a mitk::ImageReadAccessor, iterate through all pixels and check if the
value is 0 or 1 since it should be a binary image. I am not sure if there is a
more convenient method to get all segmentation pixel properties in a list or
something like that.
Hope that can help you.
Best,
Tobias
_____
Von: hannes.bene...@gmx.de <mailto:hannes.bene...@gmx.de>
<hannes.bene...@gmx.de <mailto:hannes.bene...@gmx.de> >
Gesendet: Samstag, 12. Mai 2018 14:15
An: mitk-users@lists.sourceforge.net <mailto:mitk-users@lists.sourceforge.net>
Betreff: [mitk-users] Points from segmentation
Hey everyone,
i’m quite new to programming in qt, that‘s why i need some help. Right now, i’m
working on a plug-in for mitk. I want to perfrom a principal component analysis
on some segmented objects. I figured out how to save a segmentation as .vtp
data, load ist point to a eigen:matrix and perfrom the pca and it works well.
The problem ist hat this format only gives me points of the surface, but i want
to load points of the whole body. I also tried the same with the .vti format,
but this only returns wrong information (even if i load the .vti file it is
displayed in the wrong location with the wrong spacing).
My question: Is there a way to get the segmentet points directly from the
datamanager into a eigen:matrix without the need of saving?
Best regards
Hannes
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users