# Paint segmentation not filling slice after ROI and rotate to volume plane

**URL:** <https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915>\
**Category:** Support\
**Created:** [January 23, 2018, 6:39pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915 "2018-01-23T18:39:00Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 23, 2018, 6:39pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/1 "2018-01-23T18:39:01Z")

</div>

Hi, I am using slicer 4.9.0-2017-11-23 on Windows.  
I was getting the segmentation errors previously discussed (I am segmenting an older T1+c image at 4 mm thickness) so I did this:

1. I used the crop volume and b-spline resampled at isotropic dimensions.

2. I followed this suggestion to rotate all sections to volume plane:  
[Segmentation Editor - How to disable painting on adjacent slices?](https://discourse.slicer.org/t/segmentation-editor-how-to-disable-painting-on-adjacent-slices/1459)

3. Of note, I had already done some segmentation before 1 and 2 were performed.

When I use the ‘Draw’ tool (axial slice) I still get incomplete filling of the draw outline:  
first image is outline:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c0eaa0714c64ad8222d04322c044e72ef866ce3f.jpeg)

This image is what is filled

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/a/0a2b2c2e853694331c47de5e97d5c22fc079dad7.jpeg)

I confess I am no wizard at 3dSlicer so am I doing something wrong? Thanks

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 23, 2018, 7:09pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/2 "2018-01-23T19:09:48Z")

</div>

The voxels are not aligning with your view, so you get a staircase effect. You can align the view to your slices and draw like that if you want, but probably your current segmentation is fine. What does it look like in 3D?

---

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 23, 2018, 8:32pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/3 "2018-01-23T20:32:38Z")

</div>

Yes, strange the 3d (with 0.5 smoothing) looks fine and filled in so the program does what it should. So align the view is different from ‘rotate to volume plane’ ? Is there a way to align to view?

Also since the purpose is to measure volumes I will want to make sure I get the segmentation correct.  
Thanks,  
John

---

<div class="post-metadata">

**Author:** ![Ahmed\_Soufane](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@Ahmed\_Soufane](https://discourse.slicer.org/u/Ahmed_Soufane)\
**Post date:** [January 23, 2018, 9:00pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/4 "2018-01-23T21:00:08Z")

</div>

Dear John,

Would you please tell me how to access/edit/modify the rotation and zoom  
in/out of an image on 3dslicer using python console.??

Thank you,  
Sincerely,  
Ahmed Soufane

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 23, 2018, 9:06pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/5 "2018-01-23T21:06:00Z")

</div>

@Ahmed_Soufane You’ve answered to an email related to another thread, where it’s off-topic. Please keep using the thread you started

> [@Rotation&zooming](https://discourse.slicer.org/t/rotation-zooming/1912):
>
> Hello, How can I modify or call the rotation of an image on the python interactor on 3dslicer ? Is it possible to modify or edit zooming in and out of the image on python console ?

Looking into Steve’s suggestion will solve your problem

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 23, 2018, 9:08pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/6 "2018-01-23T21:08:33Z")

</div>

Yes, the function you want is “Rotate to volume plane” in the slice view controller’s toolbar.

---

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 23, 2018, 9:22pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/7 "2018-01-23T21:22:46Z")

</div>

Hi Csaba, yes I had already rotated to volume plane (see my first post), and after that I was still getting the problem. Maybe that all has to happen at the very beginning prior to any segmentation?

I might add that using the ‘Paint’ tool worked different from the ‘Draw’ tool. The images above occur with the ‘draw’ tool.

[Edit] OK, If I set up **all views prior to segmentation** , now it appears to work fine.

---

<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 23, 2018, 11:08pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/8 "2018-01-23T23:08:27Z")

</div>

> [@JohnK](#):
>
> Of note, I had already done some segmentation before 1 and 2 were performed.

If you create a segmentation and set a master volume then it determines the geometry of the internal binary labelmap. If you later switch master volume it does not matter, it won’t change the internal geometry. You can to create a new Segmentation node, set the new volume (result of resampling) and work with that segmentation. You can copy segments from your old segmentation node using Segmentations module’s Import/export section.

Note that most effects work well on oblique slices (only level tracing and Fill between slices do not). The sampling artifacts (incomplete filling, striping) appearing at segment boundaries are not nice to look at, but they don’t affect the quality of segmentation, the segmentation is still correct and there are no holes in 3D.

---

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 30, 2018, 8:32pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/10 "2018-01-30T20:32:39Z")

</div>

Not sure if this is relevant… bug or just my new user brain.

I was getting an error again after (what i thought was) proper setup for manual segmentation with the paint tool, and made sure of the align to volume was set. (BTW, I am also segmenting longitudinal volumes that are registered that may have different slice thickness). Then the circle cursor only appears during 'sphere" and I get a different ‘tool’ cursor. Then I noticed these critical errors appeared:

class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushSphere” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushSphere” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushMaximumAbsoluteDiameter” cannot be found for effect "Erase"  
double \_\_cdecl qSlicerSegmentEditorAbstractEffect::doubleParameter(class QString) : Parameter named “BrushMaximumAbsoluteDiameter” cannot be converted to floating point number!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushAbsoluteDiameter” cannot be found for effect "Erase"  
double \_\_cdecl qSlicerSegmentEditorAbstractEffect::doubleParameter(class QString) : Parameter named “BrushAbsoluteDiameter” cannot be converted to floating point number!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushSphere” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushSphere” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushAbsoluteDiameter” cannot be found for effect "Erase"  
double \_\_cdecl qSlicerSegmentEditorAbstractEffect::doubleParameter(class QString) : Parameter named “BrushAbsoluteDiameter” cannot be converted to floating point number!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushSphere” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushSphere” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushSphere” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushSphere” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushDiameterIsRelative” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushSphere” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushSphere” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “ColorSmudge” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “ColorSmudge” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!  
class QString \_\_cdecl qSlicerSegmentEditorAbstractEffect::parameter(class QString) : Parameter named “BrushPixelMode” cannot be found for effect "Erase"  
int \_\_cdecl qSlicerSegmentEditorAbstractEffect::integerParameter(class QString) : Parameter named “BrushPixelMode” cannot be converted to integer!

---

<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 30, 2018, 11:10pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/11 "2018-01-30T23:10:16Z")

</div>

Can you provide step-by-step description of what you do so that we can reproduce the problem?

---

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 30, 2018, 11:43pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/12 "2018-01-30T23:43:22Z")

</div>

Thanks, here are the steps  
Windows 7, 64-bit, slicer ver. 4.9.0-2017-11-23 (from nightly build)

1. load 2 different T1+c MRIs taken at 2 time points
2. register the older MRI to the newer one since the older has thicker cuts (1 vs 4 mm), in plane resolution is nearly the same. Registration looks great.
3. Create a single segmentation.
4. set the active volume, then click the “rotate volume to plane” button, when all slice views are locked together (all rotate slightly after this). This is done for each master volume.
5. Manually ‘paint’ the location of the tumor - this gives me the above problems.
6. potential issues – segmentation may not all have been done on the same session. Also it seems intermittent – that is I cannot isolate a specific thing I am doing.
7. Checked memory via Task manager to ensure I have some head-room.

Thanks for your 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 31, 2018, 4:40am UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/13 "2018-01-31T04:40:05Z")

</div>

At the beginning of Step 3, is the master volume the same as the background volume in the slice viewers?

Note that the brush thickness is always the same as the slice spacing that is set in the slice viewer. If the brush size is much thinner than the slice thickness of the segmentation’s labelmap then it might not be large enough to include any voxels. This should not happen if the master volume is the background volume and slice views are rotated to volume’s plane.

---

<div class="post-metadata">

**Author:** ![JohnK](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JohnK](https://discourse.slicer.org/u/JohnK)\
**Post date:** [January 31, 2018, 6:05pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/14 "2018-01-31T18:05:22Z")

</div>

Ok, good to know.

> [@lassoan](#):
>
> At the beginning of Step 3, is the master volume the same as the background volume in the slice viewers?

I believe so. To be honest, I just make sure the volume in the viewer was the same as that listed in “Master volume.” I never actually checked but I am pretty sure none was in the Foreground. I have been consistently doing segmentations in single axial slice only. I will be sure to check this in the future.

Currently, I really can’t seem to isolate a factor that leads to this error but I can keep these issues in mind.

---

<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 31, 2018, 6:24pm UTC](https://discourse.slicer.org/t/paint-segmentation-not-filling-slice-after-roi-and-rotate-to-volume-plane/1915/15 "2018-01-31T18:24:53Z")

</div>

> [@JohnK](#):
>
> I just make sure the volume in the viewer was the same as that listed in “Master volume.”

Geometry of internal labelmap in segmentation node is determined by the **first selected master volume**. If you later change the master volume, it does not affect the geometry (slice thickness, orientation, etc). We plan to give the user some more controls over this, so that users could force changing of the labelmap geometry for an existing segmentation, but for now, if you want to change labelmap geometry in the segmentation, then you need to create a new segmentation and make sure you that the master volume you select first is the correct one.
