Commit bda61233 authored by Gabriel Couture's avatar Gabriel Couture

Changing geometry names

parent 531f494b
......@@ -36,7 +36,7 @@ def get_rtstruct(geometry: str = 'all', spacing='all') -> List[pydicom.FileDatas
Parameters
----------
geometry
Geometry: {'cones', 'spheres', 'cylinders', 'all'}.
Geometry: {'cone', 'sphere', 'cylinder', 'all'}.
spacing
Spacing in millimeters: {0.2, 1, 2, 3, 'all'}.
......@@ -52,7 +52,7 @@ def get_rtstruct(geometry: str = 'all', spacing='all') -> List[pydicom.FileDatas
geometry_paths = [os.path.join(directory, 'data', 'RTSTRUCT', geometry)]
if False in [os.path.exists(i) for i in geometry_paths]:
raise WrongGeometryError("Geometry should be in {'cones', 'spheres', 'cylinders', 'all'}")
raise WrongGeometryError("Geometry should be in {'cone', 'sphere', 'cylinder', 'all'}")
dicom_paths: List[str] = []
for geometry_path in geometry_paths:
......@@ -106,3 +106,7 @@ def get_rtplan() -> pydicom.FileDataset:
rtplan_path = os.path.join(directory, 'data', 'RTPLAN', 'RTPLAN.dcm')
return pydicom.dcmread(rtplan_path)
def get_analytic_results():
raise NotImplementedError
# coding: utf-8
# author: Gabriel Couture
from os.path import join
import pydicom
from dicomgenerator import dao
def write_dicom_rt(target_directory: str, geometry: str, dose_gradient: str) -> None:
raise NotImplementedError
rtplan = dao.get_rtplan()
rtdoses = dao.get_rtdose(dose_gradient)
rtstructs = dao.get_rtstruct(geometry)
pydicom.dcmwrite(join(target_directory, 'RTPLAN-1.dcm'), rtplan)
pydicom.dcmwrite(join(target_directory, 'RTDOSE-1.dcm'), rtdoses[0])
pydicom.dcmwrite(join(target_directory, 'RTSTRUCT-1.dcm'), rtstructs[0])
......@@ -7,7 +7,7 @@ import pydicom
from dicomgenerator import dao
from dicomgenerator.exceptions import WrongGeometryError, InvalidDoseGradientError
A_GEOMETRY = 'cones'
A_GEOMETRY = 'cone'
A_SPACING = 1.0
A_DOSE_GRADIENTS = 'AP'
A_BAD_GEOMETRY = 'A_BAD_GEOMETRY'
......
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