MultiVolumeExplorer - labeling chart error

Hi there,

I am expieriencing an error when I try using the static plotting in MultiVolumeExplorer when I want to plot signal drop with time:

Traceback (most recent call last):
File “C:/Users/Diana/AppData/Local/NA-MIC/Slicer 4.11.20200930/bin/…/lib/Slicer-4.11/qt-loadable-modules/Python/qSlicerMultiVolumeExplorerModuleWidget.py”, line 520, in onLabeledChartRequested
chartViewNode.requestChartCreation()
File “C:\Users\Diana\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Slicer-4.11\qt-loadable-modules\Python\qSlicerMultiVolumeExplorerCharts.py”, line 422, in requestChartCreation
chartNode = self.createChartNodeAndInsertData()
File “C:\Users\Diana\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Slicer-4.11\qt-loadable-modules\Python\qSlicerMultiVolumeExplorerCharts.py”, line 493, in createChartNodeAndInsertData
colorStr = Helper.RGBtoHex(rgb[0] * 255, rgb[1] * 255, rgb[2] * 255)
File “C:\Users\Diana\AppData\Local\NA-MIC\Slicer 4.11.20200930\lib\Slicer-4.11\qt-loadable-modules\Python\qSlicerMultiVolumeExplorerModuleHelper.py”, line 9, in RGBtoHex
return ‘#%02X%02X%02X’ % (r,g,b)
TypeError: %X format: an integer is required, not float

I have different samples (different segments) in one volume, and they end up totally messed up on the chart… can anyone help me solve this out, please?

I use the newest stable version (4.11.20200930)

Thanks for any help!

Does plotting works correctly if you load the data as a volume sequence and use plotting in Sequences module?

If not, please save your scene as .mrb file, upload it somewhere and post the link here so that we can investigate.

Dear Andras,

thank you very much for your reply! The interactive plotting works fine for both, the Sequences and MiltiVolumeExplorer modules. The problem appears when I want to plot the chart:
image

I tried the previous stable version (4.10.2) and there it worked fine, the arrays are labelled accordingly to segments (samples):
image

Can this be fixed in the newest version?

Can you describe the steps to create this chart (what module you open, what buttons you click)?

I load the data (as a 29 frames MultiVolume by EchoTime) and create a segmentation with 14 segments in ‘SegmentEditor’. Then in ‘Segmentations’ I export as LabelMap.

I open the MultiVolumeExplorer, and in interactive plotting everything looks fine, I select ‘Probed label volume’ under ‘Plotting Settings’ and when I click ‘Chart’ the error above occurs. The chart is first empty, I have to manually click it in the drop down menu (in the 4.10.2 version, the chart appeared automatically). The values look correct but the assignment to the segments is not.

Hi everyone I encounter the same problem working on a windows system, exactly as described by Diana?
Has there been a solution in the meantime?
Thanks for your Help
best Florian

It works fine, you just need to use a scatter plot of an X and Y series.

Line plot just shows one series, which defines the Y values. X values simply contain the indices (0, 1, 2,…).

Thanks for your response!
I m not sure if I have understood correctly. But maybe I have also not expressed my problem in enough detail.
I have a perfusion dataset and wish to picture signal intesity over time within different ROIs.
So scatter plotting is not really an option.
How do I have to tell slicer which ROI refers to which color and to represent the Signal Intensity over time accordingly?
Thanks again Florian

MultiVolume module is being replaced by Sequences module. We’ll add a dedicated module for time-intensity plots, but for now you can copy-paste this code snippet into Slicer’s Python console to generate the plot.

Hi Andras, unfortunately that didn’t work as easily as I was hoping.
I get a couple of error messages which are not that easy to decioher to a newby to Slicer and Python…
I am sure these are easy to fix once one has mastered the Slicer Coding structure … but this will take some time… maybe you could help me along with the first one?

Thanks!

>>> # get volume sequence as numpy array

>>> volumeSequenceBrowserNode = slicer.modules.sequences.logic().GetFirstBrowserNodeForProxyNode(volumeSequenceProxyNode)

Traceback (most recent call last):

File "<console>", line 1, in <module>

AttributeError: 'vtkSlicerSequencesModuleLogicPython.vtkSlicerSeque' object has no attribute 'GetFirstBrowserNodeForProxyNode'

Sorry, I forgot to mention that you need to use the latest Slicer Preview Release for this script.

Thanks Andras for your help!
Unfortunately there are still some errors… I’ll try and tackle them on the go, as I get the gist of the code…
for now I will use version 4.10. as a workaround !

Thanks and greets
Florian

You don’t need to resort to using an ancient release, such as Slicer-4.10. You can copy-paste the error message here and we can tell you what’s wrong.

Wow that’s really nice! Thanks!
I am copying the code line by line into the python console
the first error occurs in the Section:
" # get volume sequence as numpy array

volumeSequenceBrowserNode = slicer.modules.sequences.logic().GetFirstBrowserNodeForProxyNode(volumeSequenceProxyNode)

volumeSequenceNode = volumeSequenceBrowserNode.GetSequenceNode(volumeSequenceProxyNode)"

"Traceback (most recent call last):

File “”, line 1, in

AttributeError: ‘NoneType’ object has no attribute ‘GetSequenceNode’"

You can need to load the 4D data set as “Volume sequence” and set volumeSequenceProxyNode to the volume node that displays the image that is changing in time.

Thanks Andras ! Problem solved! Perfect!