MingGatsby
commited on
Commit
•
2c04947
1
Parent(s):
edc1fd8
Update app.py
Browse files
app.py
CHANGED
@@ -105,26 +105,26 @@ WINDOW_WIDTH_MAX = 3000
|
|
105 |
# Evaluation Transforms
|
106 |
eval_transforms = Compose(
|
107 |
[
|
108 |
-
LoadImage(image_only=True),
|
109 |
AsChannelFirst(),
|
110 |
ScaleIntensityRangePercentiles(lower=20, upper=80, b_min=0.0, b_max=1.0, clip=False, relative=True),
|
111 |
Resize(spatial_size=SPATIAL_SIZE)
|
112 |
]
|
113 |
)
|
114 |
|
115 |
-
# CAM
|
116 |
-
|
117 |
[
|
118 |
-
LoadImage(image_only=True),
|
119 |
AsChannelFirst(),
|
120 |
Resize(spatial_size=SPATIAL_SIZE)
|
121 |
]
|
122 |
)
|
123 |
|
124 |
-
#
|
125 |
original_transforms = Compose(
|
126 |
[
|
127 |
-
LoadImage(image_only=True),
|
128 |
AsChannelFirst()
|
129 |
]
|
130 |
)
|
@@ -210,7 +210,7 @@ if uploaded_ct_file is not None:
|
|
210 |
)
|
211 |
|
212 |
# Load the original DICOM image for display
|
213 |
-
display_image_tensor =
|
214 |
display_image = display_image_tensor.squeeze()
|
215 |
|
216 |
# Transform the image and apply windowing
|
@@ -277,7 +277,7 @@ if uploaded_mri_file is not None:
|
|
277 |
)
|
278 |
|
279 |
# Load the original DICOM image for display
|
280 |
-
display_image_tensor =
|
281 |
display_image = display_image_tensor.squeeze()
|
282 |
|
283 |
# Transform the image and apply windowing
|
|
|
105 |
# Evaluation Transforms
|
106 |
eval_transforms = Compose(
|
107 |
[
|
108 |
+
LoadImage(image_only=True, reader="ITKReader"),
|
109 |
AsChannelFirst(),
|
110 |
ScaleIntensityRangePercentiles(lower=20, upper=80, b_min=0.0, b_max=1.0, clip=False, relative=True),
|
111 |
Resize(spatial_size=SPATIAL_SIZE)
|
112 |
]
|
113 |
)
|
114 |
|
115 |
+
# CAM Transforms
|
116 |
+
cam_transforms = Compose(
|
117 |
[
|
118 |
+
LoadImage(image_only=True, reader="ITKReader"),
|
119 |
AsChannelFirst(),
|
120 |
Resize(spatial_size=SPATIAL_SIZE)
|
121 |
]
|
122 |
)
|
123 |
|
124 |
+
# Original Transforms
|
125 |
original_transforms = Compose(
|
126 |
[
|
127 |
+
LoadImage(image_only=True, reader="ITKReader"),
|
128 |
AsChannelFirst()
|
129 |
]
|
130 |
)
|
|
|
210 |
)
|
211 |
|
212 |
# Load the original DICOM image for display
|
213 |
+
display_image_tensor = cam_transforms(temp_file.name).unsqueeze(0).to(device)
|
214 |
display_image = display_image_tensor.squeeze()
|
215 |
|
216 |
# Transform the image and apply windowing
|
|
|
277 |
)
|
278 |
|
279 |
# Load the original DICOM image for display
|
280 |
+
display_image_tensor = cam_transforms(temp_file.name).unsqueeze(0).to(device)
|
281 |
display_image = display_image_tensor.squeeze()
|
282 |
|
283 |
# Transform the image and apply windowing
|