Skip to content

Commit

Permalink
added basic IO functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkazmier committed Jan 16, 2020
1 parent 2afb431 commit dfb11dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Empty file added imgtools/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions imgtools/io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import SimpleITK as sitk
from pydicom import dcmread


def read_dicom_series(path):
reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(path)
reader.SetFileNames(dicom_names)
return reader.Execute()


def read_image(path):
return sitk.ReadImage(path)


def read_dicom_rtstruct(path):
return pydicom.dcmread(path)

0 comments on commit dfb11dd

Please sign in to comment.