Hi,all.
Here is one red slice of my image data(.vtk format)
I get this slice with the following code,
volume_node = slicer.util.getNode("vtkMRMLScalarVolumeNode1")
image = slicer.util.arrayFromVolume(volume_node)
red_slice = image[50,:,:]
However,its voxels are raw values which is not in [0,255] range.If I take a screenshot on this red slice and get a .png format picture,its pixels can convert into range [0,255].
I want to know if there is a way to convert the slice with the raw data.
This pseudocode is used to illustrate the idea.
red_slice = image[50,:,:] # image is raw data, voxels are not in [0,255]
gray_red_slice = convert_to_gray_image(image[50,:,:]) # some function/methods to convert the intensity values
Thanks in advance for your help and advice!