VTK image using slicer resulted Empty spaces

We have a medical imaging viewer support slicing in Axial, Sagittal and coronal directions using vtkImageReslice and i’d like to add Oblique slicing
the result looks fine but i have a stupid issue in the resulted image in the oblique slice that the background filled by grey color in the empty spaces
the only difference in the rendering path is the slice extent at Diagonal slicing , which is larger than the Horizontal and vertical
i tried vtkImageReslice::SetBackgroundLevel(0) and SetBackgroundColor(0, 0, 0, 0)
to fill empty spaces by black color but remain grey
what could be the fault in my code? and sorry for the trivial question

For CT images, it is common for the value of air to be -1000, and for the value of water to be 0. So air (at -1000) is black, and water (at zero) is gray.

So try SetBackgroundLevel(-1000) or perhaps SetBackgroundLevel(-1024). To be sure of the correct value, check the RescaleIntercept (0028,1052) attribute of the DICOM files.

1 Like

Than you David , that was really helpful
but should the background level be changed based on Modality? if the source was MRI , Ultrasound or whatever . should i check that and change the BG level ?

For MRI, Ultrasound, and PET the background is zero. CT is special in that it uses negative values.

1 Like

will try MRI data also, thank David so much for your effort and time , really appreciate that