Commit 1193e5cf3d0a86807a9bc69fff4fb40e4654be57
1 parent
fb797bab
Exists in
master
and in
68 other branches
FIX: fixed bug gradient editor initial value incorrect
Showing
1 changed file
with
10 additions
and
5 deletions
Show diff stats
invesalius/reader/dicom_reader.py
... | ... | @@ -27,14 +27,15 @@ import dicom |
27 | 27 | import dicom_grouper |
28 | 28 | from data.imagedata_utils import ResampleImage2D |
29 | 29 | |
30 | +import constants as const | |
30 | 31 | def LoadImages(dir_): |
31 | 32 | # TODO!!! SUPER GAMBIARRA!!! DO THIS BETTER |
32 | 33 | |
33 | - if 0: | |
34 | - fow = vtk.vtkFileOutputWindow() | |
35 | - fow.SetFileName('vtk_output.txt') | |
36 | - ow = vtk.vtkOutputWindow () | |
37 | - ow.SetInstance (fow) | |
34 | + #if 0: | |
35 | + fow = vtk.vtkFileOutputWindow() | |
36 | + fow.SetFileName('vtk_output.txt') | |
37 | + ow = vtk.vtkOutputWindow () | |
38 | + ow.SetInstance (fow) | |
38 | 39 | |
39 | 40 | dcm_files, acquisition_modality = GetDicomFiles(dir_) |
40 | 41 | |
... | ... | @@ -123,6 +124,10 @@ def LoadImages(dir_): |
123 | 124 | |
124 | 125 | img_axial.Update() |
125 | 126 | |
127 | + thresh_min, thresh_max = img_axial.GetScalarRange() | |
128 | + const.THRESHOLD_INVALUE = thresh_max | |
129 | + const.THRESHOLD_OUTVALUE = thresh_min | |
130 | + | |
126 | 131 | return img_axial, acquisition_modality, tilt |
127 | 132 | |
128 | 133 | def GetDicomFiles(path, recursive = False): | ... | ... |