Thanks again Peter!
Yes, I am guiding myself over those files of the diffusion plugins.
I have just noticed something, when I print the name of the array (
Snippet FiberData->GetPointData()->GetArrayName() ) it hasnt changed to
"custom". It still is "Color_Orient" and doesnt match Snipp
fiber->GetCurrentColorCoding();
Miguel
On 06.11.2014 13:11, Peter Neher wrote:
Hi Miguel,
we are also using a vtkPolyDataMapper. You should find everything you
need in mitk::FiberBundleXMapper3D. The "InternalGenerateData" method
does all the magic.
Peter
On 06.11.2014 12:05, Miguel Nunes wrote:
Hi Peter,
thanks for the input. I followed your tips and it works now. In the
MITK windows, the track colors get updated :)
I just have a small issue. I am using a separate mapper
(vtkPolyDataMapper* mesh_mapper Snippet ) that gets confused about
the colors array to use.
Snippet
mesh_mapper->ScalarVisibilityOn();
mesh_mapper->SetScalarModeToUsePointFieldData();
mesh_mapper->SelectColorArray(fiber->GetCurrentColorCoding());
mesh_mapper->Update();
The mapper gets updated. When I change to custom color its doesn't
find /render the colors, but when I go back to color_orient it
renders correctly. (There us no DoColorCodingCustomBased() ...)
Thanks again!
Best,
Miguel
On 06.11.2014 10:22, Peter Neher wrote:
Hi Miguel,
to color the fibers according to an image with scalar values use
myFiberBundleX->SetFAMap(MyMitkImage);
myFiberBundleX->SetColorCoding(mitk::FiberBundleX::COLORCODING_FA_BASED);
myFiberBundleX->DoColorCodingFaBased();
To set your custom color use
float color[3]; color[0]=1; color[1]=0; color[2]=0.4;
myFiberDataNode->SetProperty("color",mitk::ColorProperty::New(color[0],
color[1], color[2]));
mitk::FiberBundleX::Pointer myFiberBundleX =
dynamic_cast<mitk::FiberBundleX*>(myFiberDataNode->GetData());
myFiberBundleX->SetColorCoding(mitk::FiberBundleX::COLORCODING_CUSTOM);
Does that work?
Peter
On 04.11.2014 14:53, Miguel Nunes wrote:
Hi there again,
I have been trying to implement some colouring in the fibers but
nothing changes.
I am basing my implementation of what I find in the MITK source,
but there is actually no plugin where colours of tracks get changed...
This is part of my code, and I get the correct cout´s:
Snippet
if(strcmp(cc,mitk::FiberBundleX::COLORCODING_ORIENTATION_BASED) ==0)
{
cout <<"1" << endl;
fiber->SetColorCoding(mitk::FiberBundleX::COLORCODING_ORIENTATION_BASED);
fiber->DoColorCodingOrientationBased();
}
else if(strcmp(cc,mitk::FiberBundleX::COLORCODING_FA_BASED)==0)
{
cout <<"2" << endl;
fiber->SetColorCoding(mitk::FiberBundleX::COLORCODING_FA_BASED);
fiber->DoColorCodingFaBased();
}
else //custom color
{
cout <<"3" << endl;
int rgbcolor[3];
rgbcolor[0] = 255;
rgbcolor[1] = 0;
rgbcolor[2] = 100;
fiber->SetColorCoding(mitk::FiberBundleX::COLORCODING_CUSTOM);
geometryNodeArray[0]->SetProperty("color",mitk::ColorProperty::New(rgbcolor[0],
rgbcolor[1], rgbcolor[2]));
geometryNodeArray[0]->Modified();
}
I dont know what I am missing...
btw, I am still using the MITK 2013.09.
Best,
Miguel
On 15.10.2014 11:31, Miguel Nunes wrote:
Thank you so much for the quick answer, Peter!
I managed to solve my translation issue.
Regarding the other question, I will investigate this setFAmap. If I dont
manage to get this working I will come back to you.
Best regards,
Miguel
On Wednesday, October 15, 2014 11:03 CEST, Peter Neher<[email protected]> wrote:
Hi Miguel,
MITK always uses world coordinates for the fiber points. Thus, no
transformation is needed and the matrix is set to identity. The bounding
box of the fibers is different from the image bounding box since the
fibers don't necessarily have to occupy the same volume as the image
they were obtained from.
Regarding your second question, the fiber colors are calculated in the
FiberbundleX class. The default orientation colorcoding is calculated in
DoColorCodingOrientationBased() and a custom color coding, e.g. FA based
color coding, is done in the method "SetFAMap" of the FiberBundleX.
I hope that helps!
Cheers,
Peter
On 14.10.2014 18:18, Miguel Nunes wrote:
Hello MITK List,
I am having a interesting problem. I am loading a Track file (trk) and the
respective accompanying MR datasets and segmentations.
After loading the datasets, all datasets are correctly aligned in the
stdmultiwidget.
But for my plugin I need to access the transformation between the datasets and
I cannot achieve this. There is always some miss calculations. For example, if
I ask the geometry3D for the bounding box of the dataset, it gives me different
values comparing to when I get these values from the vtkPolyData inside the
mitkFiberBundleX. The two returning BB are not the same.
When I check the details of the Fiber dataset, it is only shown an identiy
matrix and the BBox, without any transformation. But the BBoxes of the track
and the MR image are different. So, how does MITK align them?
Also, I do not understand how the colors of the fibers get rendered. As far as I
have found there is only a
fib->SetColorCoding(mitk::FiberBundleX::COLORCODING_CUSTOM) (and similar) which
leads me nowhere. the render functions of geometry only lead me in circles...
Thank you!
Best regards,
Miguel Nunes
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
Dr. sc. hum. Peter F. Neher
Division Medical and Biological Informatics
Junior Group Medical Image Computing (MIC)
German Cancer Research Center (DKFZ)
Im Neuenheimer Feld 280
69120 Heidelberg
Germany
phone: +49 6221 42-3552
fax: +49 6221 42-2345
[email protected]
http://www.dkfz.de/de/mbi/people/Peter_Neher.html
Confidentiality Note:
This message is intended only for the use of the named recipient(s) and may
obtain confidential and/or privileged information. If you are not the intended
recipient, please contact the sender and delete the message. Any unauthorized
use of the information contained in this message is prohibited.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
Dr. sc. hum. Peter F. Neher
Division Medical and Biological Informatics
Junior Group Medical Image Computing (MIC)
German Cancer Research Center (DKFZ)
Im Neuenheimer Feld 280
69120 Heidelberg
Germany
phone: +49 6221 42-3552
fax: +49 6221 42-2345
[email protected]
http://www.dkfz.de/de/mbi/people/Peter_Neher.html
Confidentiality Note:
This message is intended only for the use of the named recipient(s) and may
obtain confidential and/or privileged information. If you are not the intended
recipient, please contact the sender and delete the message. Any unauthorized
use of the information contained in this message is prohibited.
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
Dr. sc. hum. Peter F. Neher
Division Medical and Biological Informatics
Junior Group Medical Image Computing (MIC)
German Cancer Research Center (DKFZ)
Im Neuenheimer Feld 280
69120 Heidelberg
Germany
phone: +49 6221 42-3552
fax: +49 6221 42-2345
[email protected]
http://www.dkfz.de/de/mbi/people/Peter_Neher.html
Confidentiality Note:
This message is intended only for the use of the named recipient(s) and may
obtain confidential and/or privileged information. If you are not the intended
recipient, please contact the sender and delete the message. Any unauthorized
use of the information contained in this message is prohibited.
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users