Commit c740e36
committed
Address concerns that the rescaled pixel array from DICOM is of type float64.
In the last version, rescale slope and intercept values were tried to cast to
the smallest can_cast Nunpy type. Using pydicom apply_rescale loses this as it
returns float64 if rescale slope and intercept are applied. So, enhancing the
code will test for equivalence before "unsafely" casting the data. This will
NOT reduce the mem usage of this operator as a new array will be created by
casting from float64, and there is a small overhead for the checks. However,
there are cases where downstream custom operators may save memory footprint.
Signed-off-by: M Q <[email protected]>1 parent 55148bd commit c740e36
1 file changed
+15
-11
lines changedLines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
0 commit comments