Commit 2dd530d10f56fbe81ec6a0b889dedfdff3aed902
1 parent
1ea30e1a
Exists in
master
and in
6 other branches
FIX: Again function to reduce vtkImageData with 3 dimension.
Showing
1 changed file
with
8 additions
and
8 deletions
Show diff stats
invesalius/reader/dicom_reader.py
... | ... | @@ -25,7 +25,7 @@ import gdcm |
25 | 25 | |
26 | 26 | import dicom |
27 | 27 | import dicom_grouper |
28 | -from data.imagedata_utils import ResampleMatrix | |
28 | +from data.imagedata_utils import ResampleImage2D | |
29 | 29 | |
30 | 30 | def LoadImages(dir_): |
31 | 31 | # TODO!!! SUPER GAMBIARRA!!! DO THIS BETTER |
... | ... | @@ -92,22 +92,22 @@ def LoadImages(dir_): |
92 | 92 | for x in xrange(len(files)): |
93 | 93 | if not(reduce_matrix): |
94 | 94 | array.InsertValue(x,files[x]) |
95 | - else: | |
95 | + else: | |
96 | 96 | #SIf the resolution of the |
97 | 97 | #matrix is very large |
98 | 98 | read = vtkgdcm.vtkGDCMImageReader() |
99 | 99 | read.SetFileName(files[x]) |
100 | 100 | read.Update() |
101 | - | |
101 | + | |
102 | 102 | #Resample image in x,y dimension |
103 | - img = ResampleMatrix(read.GetOutput(), 256) | |
104 | - | |
103 | + img = ResampleImage2D(read.GetOutput(), 256) | |
104 | + | |
105 | 105 | #Stack images in Z axes |
106 | 106 | img_app.AddInput(img) |
107 | - | |
107 | + | |
108 | 108 | img_app.Update() |
109 | 109 | img_axial = vtk.vtkImageData() |
110 | - | |
110 | + | |
111 | 111 | if (reduce_matrix): |
112 | 112 | img_axial.DeepCopy(img_app.GetOutput()) |
113 | 113 | img_axial.SetSpacing(img_axial.GetSpacing()[0],\ |
... | ... | @@ -117,7 +117,7 @@ def LoadImages(dir_): |
117 | 117 | read = vtkgdcm.vtkGDCMImageReader() |
118 | 118 | read.SetFileNames(array) |
119 | 119 | read.Update() |
120 | - | |
120 | + | |
121 | 121 | img_axial.DeepCopy(read.GetOutput()) |
122 | 122 | img_axial.SetSpacing(spacing, spacing, spacing_z) |
123 | 123 | ... | ... |