Fork me on GitHub
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Definition of Colour Code

Definition of Colour Code 5 years 11 months ago #242

  • Viertann
  • Viertann's Avatar
Hey,

I need the Definition of the Colour Code which is used to describe directions in DTI. Images like ColFa and Fibretracks an stuff like that use RGB to show the directions. What i need is an exact definition which tells me which colour is for which direction. Can you tell me where i can find that?


Thanks


Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #244

  • ocommowick
  • ocommowick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 49
  • Thank you received: 5
  • Karma: 7
Hi,

We use for the color coding in diffusion the classical colors used elsewhere, based on the principal direction of the tensor (or the fiber direction). These are the following :

- up/down direction : blue (eg cortico spinal tracts)
- left-right direction : red (eg corpus callosum)
- anterior/posterior direction : green (eg associative tracts of the brain)

Any direction is then colored using a mixture of those colors depending on its decomposition on those directions.

Hope that helps
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #245

  • Viertann
  • Viertann's Avatar
Hi,
thanks for your quick reply. I did some research on this topic the last few hours and found out, that there are different color working spaces which are all based on RGB. Every color working space has a matrix with which you can calculate the vector which was expressed by the color out of the RGB number triple. Do you know which color working space is used in MedInria? Examples are: Adobe RGB, Apple RGB, BestRGB, BetaRGB...

hope you can help

thanks

Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #247

  • ocommowick
  • ocommowick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 49
  • Thank you received: 5
  • Karma: 7
Hi,

I am not that much familiar of these things but here is what I found. In our code, we only compute the rgb value from the data. Let me give you an example. Let's assume that we have a direction v for which we want to get the color (eg that direction may be the principal tensor orientation). We do the following:

r = fabs(v[0])
g = fabs(v[1])
b = fabs(v[2])

Then, we give this color to VTK which adds it to the object to be displayed. I have the feeling that, from there, it's your system and your screen that decide how that RGB color is displayed.

Hope it helped a bit more...
Last Edit: 5 years 11 months ago by ocommowick.
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #249

  • Viertann
  • Viertann's Avatar
Hi,
Thank you very much, that helped a lot, but could you tell me what exactly v(i) is? Are these the Eigenvectors of the Diffusion Tensor or are they vectorcomponents of the biggest Eigenvector? And if they are Eigenvectors then there musst be a norm funktion in the fabs funktion, so that we get a scalar for the colour value. Is it like that? I also have another Question but I'll start a new topic for that.

Thanks again

Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #251

  • ocommowick
  • ocommowick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 49
  • Thank you received: 5
  • Karma: 7
v is the eigenvector of the tensor with the highest eigenvalue, and has a unit norm by construction. Then v[0] is the x coordinate of v, v[1] is the y coordinate, ... In our code we use values between 0 and 1 for the r, g, and b color ranges so we don't need any rescaling of these values since v is of unit norm. However if you want r, g, b to be in between 0 and 255 you would need to resale by 255 of course.
Last Edit: 5 years 11 months ago by ocommowick.
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #254

  • Viertann
  • Viertann's Avatar
Hi again,
like I told you I am looking for a way to get the largest Eigenvector for every Voxel in a Vecotrfield as list, not as picture. I thought I could calculate the Vectors out of the Color Code in ColFa. The thing is when you make every component positive to calculate the Color of the Voxel, there are several possible Vectors when you compute it in reverse. So could you imagine another possibility to get the main Eigenvector in every Voxel? I think it would also work with the Tensor in every Voxel. Then we would compute the largest Eigenvectors by ourselves. Perhaps you know a developer who could help me or know a link with a library which describes the encoding of the Tensor.nii file, which can be exported so we could decode it. I hope you can help.

Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #255

  • ocommowick
  • ocommowick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 49
  • Thank you received: 5
  • Karma: 7
Ok, now I get what you wanted to do. It will be clearly difficult to get the eigen vector from the col fa (if not impossible. The thing is the color in these images is not only scaled by FA but also cast to unsigned int so you would lose precision.

However I think there is hope. You can definitely output the tensor volume. In medinria, if you click on show tensors, you will have a new volume added to your non persistent database. You can export this volume as a nifti file like any other image.

We store tensors as a vector image where each pixel has six components. These six components define the tensor as follows:

T = [
D0 D1 D3
D1 D2 D4
D3 D4 D5
]

So you can read your image in matlab or using anything else you want, recreate the tensors and extract from them the principal eigenvector. If you know about C++, ITK and stuff like this, TTK (tensor toolkit) may also be of interest to you. It provides a set of tools that you can use on the tensor images we produce (gforge.inria.fr/projects/ttk/). I am not sure it can output the principal eigenvector as an image but it definitely has some code that could be of interest to you.

Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #256

  • Viertann
  • Viertann's Avatar
Hi,
Thanks Olivier (funny that we have the same name :) ) that was very helpfull. I'll try to get the Tensors with mathlab. But when you say any way you want, what do you mean? Are there several Programms which can read nifti files and put out the Tensors? I got a similar answer in another forum, but didn't find Programms who can do that. If there are more Programms could you tell me which?
I'd apreciate that.

Thanks

Olivier
The administrator has disabled public write access.

Re: Definition of Colour Code 5 years 11 months ago #259

  • ocommowick
  • ocommowick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 49
  • Thank you received: 5
  • Karma: 7
Hi,

I was thinking of matlab but also of some C++ libraries available here and there on the web. For all of those, you'll need to have some coding abilities or at least know how to compile and run the command line tools if they fit your needs.

The most basic one on which most of the others rely is ITK (itk.org) which can read nifti files. There is also TTK (gforge.inria.fr/projects/ttk/) which is dedicated to tensor processing (on which we rely in medinria). There are a bunch of others like Camino or DTI-TK but I don't know them that much.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.178 seconds