Skip to content

Commit

Permalink
Enable MR files
Browse files Browse the repository at this point in the history
  • Loading branch information
janpipek committed Aug 27, 2014
1 parent 33cb5ed commit 2f70dda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pydiq/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,17 @@ def file_name(self, value):
self._file_name = value
try:
self.file = dicom.read_file(self._file_name)
self.data = self.file.RescaleSlope * self.file.pixel_array + self.file.RescaleIntercept
self.modality = self.file.Modality
if self.modality == "CT":
self.data = self.file.RescaleSlope * self.file.pixel_array + self.file.RescaleIntercept
else:
self.data = self.file.pixel_array
self.image_position = np.array([float(t) for t in self.file.ImagePositionPatient])
self.pixel_spacing = np.array([float(t) for t in self.file.PixelSpacing])
self.setWindowTitle("pydiq: " + self._file_name)
except:
self.file = None
self.data = np.ndarray((512, 512), np.int8)
self.data = np.ndarray((0, 0), np.int8)
self.update_image()
self.setWindowTitle("pydiq: No image")
self.update_coordinates()
Expand Down

0 comments on commit 2f70dda

Please sign in to comment.