# Put vtkImageData on Red Yellow Green view

**URL:** <https://discourse.slicer.org/t/put-vtkimagedata-on-red-yellow-green-view/10201>\
**Category:** Development\
**Tags:** loadable-module\
**Created:** [February 11, 2020, 2:02pm UTC](https://discourse.slicer.org/t/put-vtkimagedata-on-red-yellow-green-view/10201 "2020-02-11T14:02:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CreepyTrick](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@CreepyTrick](https://discourse.slicer.org/u/CreepyTrick)\
**Post date:** [February 11, 2020, 2:02pm UTC](https://discourse.slicer.org/t/put-vtkimagedata-on-red-yellow-green-view/10201/1 "2020-02-11T14:02:49Z")

</div>

Hello

I want to put an vtkImageData on the RGY view….  
I already initialized my image data like this:

```auto
	img->SetExtent(….)
	img->AllocateScalars(VTK_DOUBLE, 1);
	for (….)
	{
		for (….)
		{
			img->SetScalarComponentFromDouble( …...);
		}
	}

```

It give me (let’s suppose ….) an orange square in a test renderView.  
I want that orange square to be on a certain position on the red view in Slicer, like this (photoshoped result):  
 ![squareXRed](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/d/ddec91da028fa0b85bd183b6febdf86ca35051b8.jpeg)

So i face two problems …  
Get the redView and manipulate it  
A correct way to set bounds…

My current result:

 ![CaptureIHAVE](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/f/7f6a78c2b34ecf7c8cb99b49d516a6234ae121ef.png)  
(Not really beautiful…)

I reach that point with that code:

```auto
qSlicerLayoutManager* layoutManager = qSlicerApplication::application()->layoutManager();

vtkRenderWindowInteractor* interactor = layoutManager->sliceWidget("Red")->sliceView()->interactor();
vtkRendererCollection *rendererCollection= interactor->GetRenderWindow()->GetRenderers();

//ImageActor is my vtkImageData red square
rendererCollection->GetFirstRenderer()->AddActor(imageActor);

```

Any ideas ?
