From ae5620c915ace2d6e58fad7560932f0a09c74c7c Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Wed, 9 Sep 2009 14:14:29 +0000 Subject: [PATCH] FIX: Bug window and level initial to dicom study --- invesalius/control.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index 862867d..2099490 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -80,9 +80,10 @@ class Controller(): proj.SetAcquisitionModality(acquisition_modality) proj.imagedata = imagedata proj.original_orientation = orientation - proj.window = window = const.WINDOW_LEVEL['Bone'][0] - proj.level = level = const.WINDOW_LEVEL['Bone'][1] - + threshold_range = proj.imagedata.GetScalarRange() + proj.window = window = threshold_range[1] - threshold_range[0] + proj.level = level = (0.5 * (threshold_range[1] + threshold_range[0])) + ps.Publisher().sendMessage('Update window level value',\ (proj.window, proj.level)) @@ -93,13 +94,11 @@ class Controller(): proj.SetAcquisitionModality(acquisition_modality) proj.imagedata = imagedata proj.original_orientation = orientation - + proj.window = window + proj.level = level threshold_range = proj.imagedata.GetScalarRange() - - proj.window = window = threshold_range[1] - threshold_range[0] - proj.level = level = (0.5 * (threshold_range[1] + threshold_range[0])) - + const.WINDOW_LEVEL['Default'] = (window, level) const.WINDOW_LEVEL['Other'] = (window, level) -- libgit2 0.21.2