# Visualization of 3 Channel image in a scalar volume

**URL:** https://discourse.slicer.org/t/visualization-of-3-channel-image-in-a-scalar-volume/335
**Category:** Development
**Created:** [May 17, 2017, 7:54pm UTC](https://discourse.slicer.org/t/visualization-of-3-channel-image-in-a-scalar-volume/335 "2017-05-17T19:54:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![samira](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@samira](https://discourse.slicer.org/u/samira)
#### Post date: [May 17, 2017, 7:54pm UTC](https://discourse.slicer.org/t/visualization-of-3-channel-image-in-a-scalar-volume/335/1 "2017-05-17T19:54:46Z")

</div>

Hi All,

I am currently writing a loadable module to generate a colormap and overlay it on top of a BMode image and I want to show the final image in the Slice view window.  
However, my final vtkImage has three channels the slicer shows it as a gray image.  
When I save the current scalar volume to a .jpg file is colored.  
The volume info of the volume shows it has 3 channels and scalar range is between 0 and 255.  
Do you have any idea how I can visualize the colored image in the Slicer?  
Here is my code to create the scalar volume:

```
vtkSmartPointer<vtkMRMLScalarVolumeNode> colormapVol = vtkSmartPointer<vtkMRMLScalarVolumeNode>::New();

colormapVol = u_logic->ApplyColormap(InputNode);

this->GetMRMLScene()->AddNode(colormapVol.GetPointer());

vtkNew<vtkMRMLScalarVolumeDisplayNode> colormapDisplay;
this->GetMRMLScene()->AddNode(colormapDisplay.GetPointer());
colormapVol->SetAndObserveDisplayNodeID(colormapDisplay->GetID());

```

Thanks,  
Samira

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [May 18, 2017, 4:53pm UTC](https://discourse.slicer.org/t/visualization-of-3-channel-image-in-a-scalar-volume/335/2 "2017-05-18T16:53:07Z")

</div>

If you want to do a color image you need to make a vtkMRMLVectorVolume node.

---

<div class="post-metadata">

### Author: ![samira](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@samira](https://discourse.slicer.org/u/samira)
#### Post date: [May 18, 2017, 10:17pm UTC](https://discourse.slicer.org/t/visualization-of-3-channel-image-in-a-scalar-volume/335/3 "2017-05-18T22:17:57Z")

</div>

That worked thank you.
