Usrbin plot for voxel geometry

Dear expert,

I tried to plot an USRBIN output along with adult male geometry. Although the single geometry plot is perfect, but with usrbin output, it is getting distorted. Can you please guide to resolve this?

Also, in this case, the usrbin output is plotted for 1 bin projection of y axis. Does this y bin upper and lower limit need to be consistent with the center of the geometry?

For example, the y center of the geometry is set as 20, where as in usrbin, y projection limits are 19.96 and 20.32. Will this create any issue?

Regards,
Riya

Hi Riya,

to adjust the aspect ratio of the plot see:

The position of the geometry should be automatically determined as the center of the projection by Flair. Since voxel geometries only change at the bin boundaries, it doesn’t matter where the geometry is inside a specific bin.

Cheers,
David

1 Like

Thank you @horvathd , it worked. Is it possible to plot the lung geometry only (or any particular region of our choice since everything is loaded in the form of voxel, so is there any option to view only that voxel omitting other voxels from the view port) and then add the usrbin result on top of that ?

Regards,
Riya

Hi Riya,

if you look at the voxels in 3D you can assign a color palette that is used and by defining the min. and max. range of the colors, which are mapped to tissue densities, you can get rid of parts that you do not necessarily want. Have a look at the following manual (from slide 39 onwards).

In case you want to experiment with different color - data transfer functions, you can currently do so by using your favorite text editor to create a file called “farm.ini” which you have to put into the directory where flair is installed.

In this file you should put the following line:
transfer_func = 1

The parameter specifies which of the built-in transfer functions that map the color to densities and transparencies is used. 0 is the default, 1 or 2 are alternative choices. Combining this parameter and different choices of the color palettes will allow you to highlight different types of tissues. Somewhat similar to what you can see here:

Please note that the choice of your color range, palette and transfer function are primordial in order to correctly visualize what you want. This sometimes requires a bit of playing around and tuning to get the best results.

Cheers
Chris

1 Like

Thank you @ctheis for the document. It is very intriguing to apply colors to visualize various regions. I tried to use the options and values mentioned in the document.

  1. I am unsure about the “Show” option there. Should I keep the global option on ? If I do so, the lung area is getting white. What is the reason for that? If I keep it off, then I could see rib cages. (see last two attached images)

  2. Is it possible to get a better resolution of this image? I mean is there any other option to control that ?

  3. It seems that this particular setting is revealing the bones. Other organs are denoted by same color. Is it because the min value is 0.5 and max is 2 ?

  4. Can you please guide how to choose min and max values? I was changing them arbitrarily and I could see that their values decide the color profile of the image.

  5. The min and max range of colors are mapped to tissue densities. Since the lung material density is 0.382 g/cc, I kept min and max value inside palette tab in that range (0.380 & 0.383) and got the following image (the red one). Is this what you meant by this statement ?

  1. The maximum density present in the voxel is 2.75. So if I set max value as 5 or 10 keeping the min value same in the palette tab, why the overall color is getting changed ?

Regards,
Riya

Hi Riya,

1.) The show option is used to configure some of the display parameters. I am not 100% sure what you are seeing in your pictures but it seems as if by your configuration in the show tab, you are overlaying the image of the medical renderer with some of the surrounding “region” geometry. As this is drawn only after the 3D image has been rendered, the rib-cage seems to disappear. In any case, overlaying 3D with 2D is a very specific use-case that most often does not make much sense and rather leads to confusion, while of course there are exceptions.

2.) Yes and no - to be more specific: in physical resolution one is limited by the resolution of the acquired image. One cannot get a better resolution than the voxel size from the original scan. However, during the rendering these voxels are reconstructed by shooting samples. Shooting more samples and interpolating in 3D on the data as well as their gradients allows for higher visual quality, but requires more rendering time. The medical renderer in farm supports a number of reconstruction algorithms which you can activate by moving the quality slider in the 3D settings tab to the right. Just try it out and you will immediately see the difference (see screenshot below, where the quality slider was moved one notch to the right, giving different images)

3.) - 6.)
In medical imaging we reconstruct a 3D signal by mapping a color palette to a set of density ranges. So the minimum of the color palette is mapped to the minimum value that you state in the palette settings and the same is done for the maximum. By default values below the minimum value would still get the color of the minimum and for the maximum it’s similar. This is usually not what you want because for example in your data set you might have air, with a very low density, and you do not want to see that. So you should enable Transparent for < Min and Transparent > Max.

If you now change the minimum/maximum value to which the mapping is applied then the association of the colors will change. Imagine you have 30 (or however many) colors in your palette and you set the minimum to 0 and the maximum to 3. Then, every increase of 0.1 will result also in a change of a color. If, however you set the maximum from 3 to 6 then only an increase of 0.2 will result in a change of a color. So far so good, but now it becomes a bit more complicated still :wink:

In medical imaging the mapping of the values is not only done towards a color but also towards a transparency level. For example dark colors might be opaque whereas light colors might be transparent. If you take a golden palette, choose the inverted option, then you will have dark brown colors for high values and light colors for low density values. Consequently, bones (which are dense) will be dark and opaque whereas fat tissue will be light yellow and transparent. Muscle tissue will be somewhere in between and this is what you see in your other pictures. However, a linear change from transparent to opaque is not always the best because you might have specific organs which are somewhere in between high and low density, which you might want to appear opaque as well and emphasize by a specific color.

Consequently, the combined choice of color palette, the selected min & max value and the transparency function determine what kind of tissue/organ and parts are shown and emphasized. This needs a bit of tuning and playing around, even for people who are professionals in the domain of medical imaging, and should be chosen on a case by case basis depending what the medical practitioner needs to have a look at.

For example this is the same dataset just using a different palette:

The absolute values in which your densities are given depend on your scan. But if it’s similar to the standard ones that I have seen so far, I would suggest to start setting the min to ~0.5 and the max to 2. Then I would start playing with different palettes to see which one gives you the best result for the type of body part that you would like to display. The next step is then to try different transparency transfer functions. For example for bones the default one with the golden palette works pretty well.
Try to change this transfer function by using the entry in the farm.ini file as explained in my original post. Using a value of 1, and palettes like “div” or twilight_shifted usually works quite well for soft tissue. Inverting a palette is usually quite helpful because normally they prefer dark colors for lower values but medical images are usually inverted - dark colors are good for high density objects.

Let me illustrate this with an example from the ICRP phantom.
Palette: div
Transfer function: 1
Scaling: log, smooth, inverted
min 0.2, max 1.9

Palette: div
Transfer function: 1
Scaling: log, smooth, inverted
min 0.2, max 2.9

Palette: div
Transfer function: 1
Scaling: log, smooth, inverted
min 0.2, max 5.9

Palette: div
Transfer function: 0
Scaling: log, smooth, inverted
min 0.2, max 5.9

As I said, to get the best results one needs to play around with the parameters as it depends on how the data was recorded in the scan and what one wants to show.

Hope that helps
Chris

1 Like

Thank you @ctheis for the detailed explanation. I could reproduce the images posted by you after changing transfer function and min - max values. Although I am unable to resolve the first issue i.e. if there is any overlaying 3D 2D thing happening. I only selected x-z view and set the center as 10, 20, 50. There is a void and blackbody region surrounding the voxel. Is it happening because of them ? I am attaching screenshots of the regions I have for your convenience.
1

Regards,
Riya

Moreover, you can add the Voxel layer in the layers menu and select the organs you are interested in displaying

Hi @vasilis , initially I tried that, but when I added Voxel, I could not see any Id list. Is this method not applicable for ICRP voxel data ??

Regards,
Riya

Hi @riya,

it looks as if your dataset does not include the region of interest (ROI) tagging of the individual organs. If I open the ICRP dataset I get the following where I can select lung tissue and vessels only:

Please note that for example for such cases where you have lots of soft tissue with somewhat similar densities the transfer function 2 might give best results. For example:


Careful comparison to the figure above shows that it reveals a higher level of detail and gradation of the soft lung tissue.

Cheers
Chris

Hi @ctheis ,

How did you get those organs under ROI Id? Are they automatically coming after adding .vxl file ?? I created .vxl using the writect.f using ICRP dat file and then I added materials to those voxels (As you can see in my previous attachments) . Is there any extra option that I have to include in the ASSIGNMA card? Can you please guide how to get them as ROI ??

Please find my settings (screenshots) here:

Regards,
Riya

Hi @riya,

I created the ICRP voxel phantom using FLAIR’s dicom viewer capabilities. Please have a look at a post from @vasilis here:

RT-planning example using Fluka - Applications - FLUKA User Forum (cern.ch)

This automatically generated the ROIs for me.

Cheers
Chris

The ROI should be embedded in the voxel file. Is a complicated process that is done by flair when you start with DICOM files and you have also the RTSTRUCT available.
For the ICRP 110 phantom we have made a custom procedure which for the moment is not available publicly.

Thank you @vasilis and @ctheis for the detailed discussion. We will wait for the custom procedure to get released publicly as per the developer’s policy. In the meantime, it was very helpful learning the above visualisation method as beautifully explained by @ctheis.

Apart from that it will be helpful if you can kindly provide some insight in the previously raised matter or what I can do as alternative, is not to activate the global button for show- which works fine, I guess…

Regards,
Riya

Hi Riya,

indeed, I would not activate the global button for show, in this case. Visualizing the surrounding region and blackhole probably does not make much sense for this type of application. I usually keep it off, when it comes to voxel renderings.

Cheers
Chris

1 Like

Thank you @ctheis for the clarification. One last thing… I want to superimpose the usrbin output on this geometry tab. This is the USRBIN plot I got. I added the file in layer usrbin. But I could not see any difference with and with out the usrbin data. Can you please tell if I am missing something? I am attaching the geometry layer tabs for your convenience.

Regards,
Riya

Hi Riya,

I would first suggest to add a second palette which is different then the one that you are using for the 3D voxel geometry. In the USRBIN tab you can then associated this new palette with the data and adjust the value range + colors of this palette accordingly. This will be necessary because your voxel data have for example density values between 0.2 and 2, whereas the value range of your data is probably largely different.

Cheers
Chris

Hi @ctheis ,

I have added two color palette with same range and color scheme: palette 2 and palette 3. Now I added usrbin in palette 2 only. But there is no difference in the output image (i.e. when I am clicking show - palette 2 and show - palette 3). So it means although I can see lungs in different colors, that is not because of usrbin data.

I am doing this to check whether what I am seeing is because I added usrbin data or not (Initially I was happy seeing lungs by changing the ranges, but then I found out without usrbin data, it is same). My concern is how to ensure that the output image is because of USRBIN data. In the show tab, at a time I can add only one palette to reveal. this red/ yellow image I got using 0.1 and 1000 as min and max value (which I chose by trial till I could see lungs distinctively as compared to other body parts…

On the other hand, in the usrbin plot I could see the bin energy limit is in the range 1.4E-7 to 1.8E-8. How to correlate these numbers with max min values so that the palette could correlate with usrbin output only ? Also, for the palette assigned for usrbin, what should I use as color option in the show button ? I kept the density option… My be this is not correct :thinking: …

I am sharing relevant tabs, hope my question is not very confusing, if it is, let me know…



Regards,
Riya

Hi Riya,

I will try to walk you through the process to get the following type of plot:

1.) In the show tab use the settings as shown here:

2.) The standard “Palette” is the one that you use for the voxel geometry and where you set the min/max values + colors according to the densities and what you want to highlight in your geometry.

3.) You add a second palette “Palette 2” where you define the min/max range according to the USRBIN data.

4.) You create the USRBIN layer and associate it with “Palette 2” which you created for the USRBIN data:

5.) Now you can play around by using clipping objects (or using the projection planes as clipping objects) and the option of displaying the USRBIN as texture to achieve the results that you are looking for.

Very often the use of a clipping object (e.g. box or plan) that partially clip the geometry so that you can look inside, can help to achieve the best visualization results.

cheers
Chris

1 Like

Than you @ctheis , Using clipping and projection, I could see the usrbin output. Thank you again for your time and detailed discussion.

Regards,
Riya