Incorrect display of registration result image

Hi slicer developers,

I am new to Slicer and I am working on a C++ loadable module to do image registration.
My registration module runs without any error and the resulting node is displayed in Slicer. The output has correct origin, spacing and orientation information, but the problem is that I can’t see the registered image : data is all black but when I mouse over the output volume slices, I can see that the intensity values of the image are not all 0, they are non null values.
And, when I save this output (either as a nifti file or as a dicom file) and reload it, the display is correct, I can see the registered image overlay with the fixed one.

Do you have any idea where this problem might come from ?

Thanks for your help,

Eloïse

You need to set the window/level values for display: after you create your output volume and set the input image, create a display node (volumeNode->CreateDefaultDisplayNodes()) and then call volumeNode->GetDisplayNode()->AutoWindowLevelOn().

Hi Andras,

Thank you for your response. I’ve set the window/level settings as suggested, they are correct in the Volumes module but it does not solve my problem, the view remains black but I can read values when I mouse over the slices.

Can you fix the window/level by left-click and drag on the image?

Does it help if you force resetting window/level by calling volumeNode->GetDisplayNode()->AutoWindowLevelOff() and then volumeNode->GetDisplayNode()->AutoWindowLevelOn()? Maybe instead of using the heuristics of automatic window/level, it would be even better to copy window/level setting from the input moving volume.

Maybe the order of adding nodes and setting various information in the nodes are not correct. Can you send a link to the source code of your module to the part where you create and initialize the output volume node?