Commit 4ae91cef authored by Gabriel Couture's avatar Gabriel Couture

Adding get rtplan method

parent 2b5c3c36
......@@ -84,3 +84,17 @@ def get_rtdose(dose_gradient: str, spacing: float) -> List[pydicom.FileDataset]:
dicom_paths = [os.path.join(rtdose_path, i) for i in dicom_files]
return [pydicom.dcmread(i) for i in dicom_paths]
def get_rtplan() -> pydicom.FileDataset:
"""Get a RTPLAN DICOM file.
RTPLAN DICOM file data set.
directory, _ = os.path.split(__file__)
rtplan_path = os.path.join(directory, 'data', 'RTPLAN', 'RTPLAN.dcm')
return pydicom.dcmread(rtplan_path)
......@@ -41,3 +41,10 @@ class TestDao(unittest.TestCase):
lambda: dao.get_rtdose(A_BAD_GEOMETRY, A_SPACING)
def test_whenGettingRtdose_thenResultIsARtplanFileDataSet(self):
result = dao.get_rtplan()
self.assertIsInstance(result, pydicom.FileDataset)
self.assertEqual(result['Modality'].value, 'RTPLAN')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment