# MultiVolumeExplorer - labeling chart error

**URL:** https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508
**Category:** Support
**Created:** [January 13, 2021, 4:38pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508 "2021-01-13T16:38:00Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Diana](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diana/32/3454_2.png) [@Diana](https://discourse.slicer.org/u/Diana)
#### Post date: [January 13, 2021, 4:38pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/1 "2021-01-13T16:38:01Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 13, 2021, 9:14pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/2 "2021-01-13T21:14:53Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/8/38ff62b94f2cc49a9cf0dba81b546e47f4b36a74.jpeg)

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

---

<div class="post-metadata">

### Author: ![Diana](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diana/32/3454_2.png) [@Diana](https://discourse.slicer.org/u/Diana)
#### Post date: [January 19, 2021, 10:09am UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/3 "2021-01-19T10:09:51Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/e/2e65f883698bcef81f3348fefd10d665a0c103e5.png)

I tried the previous stable version (4.10.2) and there it worked fine, the arrays are labelled accordingly to segments (samples):  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/2/729ee874c4565fb5a38575ea8e94ea9cb580e50b.png)

Can this be fixed in the newest version?

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 19, 2021, 2:44pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/4 "2021-01-19T14:44:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Diana](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/diana/32/3454_2.png) [@Diana](https://discourse.slicer.org/u/Diana)
#### Post date: [January 20, 2021, 9:11am UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/5 "2021-01-20T09:11:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [July 30, 2021, 12:21pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/6 "2021-07-30T12:21:52Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 1, 2021, 9:44pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/7 "2021-08-01T21:44:59Z")

</div>

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,…).

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [August 2, 2021, 3:00pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/8 "2021-08-02T15:00:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 2, 2021, 5:21pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/9 "2021-08-02T17:21:50Z")

</div>

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](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#plot-segments-average-intensity-over-time) into Slicer’s Python console to generate the plot.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/5/55a1bb3499056483911269c1eab985b2ba99221c.jpeg)

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [August 10, 2021, 9:00am UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/10 "2021-08-10T09:00:10Z")

</div>

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!

```python
>>> # 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'

```

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 10, 2021, 4:14pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/11 "2021-08-10T16:14:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [August 12, 2021, 2:44pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/12 "2021-08-12T14:44:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 12, 2021, 5:28pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/13 "2021-08-12T17:28:30Z")

</div>

> [@XJGB](#):
>
> 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 !

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.

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [August 13, 2021, 8:51am UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/14 "2021-08-13T08:51:32Z")

</div>

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’"

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [August 13, 2021, 1:01pm UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/15 "2021-08-13T13:01:40Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![XJGB](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xjgb/32/11830_2.png) [@XJGB](https://discourse.slicer.org/u/XJGB)
#### Post date: [August 16, 2021, 8:49am UTC](https://discourse.slicer.org/t/multivolumeexplorer-labeling-chart-error/15508/16 "2021-08-16T08:49:33Z")

</div>

Thanks Andras ! Problem solved! Perfect!
