-
Notifications
You must be signed in to change notification settings - Fork 3
Json File Format
Mark Gardner edited this page Sep 16, 2022
·
2 revisions
The information used to create the head deformations are inputted using a .json script. There are multiple examples of json scripts in the examples folder.
The input variables that can be used for the input json script are shown below:
- name (str) - The patient name as defined in the dicom metadata. In future versions this will be automatically pulled from the dicom data.
- InputDirectory (str) - The location of the directory containing the CT or CBCT dicom files. At the moment the code cannot distinguish between CT dicom files and other dicom files, so all dicom files in the input directory will be read as CT dicom files.
- OutputDirectory (str) - The location where the deformed dicom files will be written to.
- StructureDirectory (str,optional) - The path + name of the structures dicom file. If not included or left as empty, then no shift in any of the structures will be applied to the output dicom files.
- TempDirectory (str,optional) - The location of the folder where all temporary files will be written to. If not included the TempDirectory called 'nifti' will be created in the outputDirectory.
- axes (arr,optional) - The direction of the applied head rotation. For a single rotation, the axes variable is a 1 x 3 array (e.g. [1,0,0]), and for multiple rotations the axes variable is a n x 3 array (e.g. [ [1,0,0] , [0,1,0] ]). Making a value in the axes negative will reverse the direction of the rotation.
- angles (arr,optional) - The magnitude (in degrees) of the head rotation to be performed. For a single rotation the angles variable is a single number (eg. [2.5]), and for multiple rotations the angles variable is a 1 x 3 array where each value is the magnitude for each applied rotation (eg. [2.5,1.3,2.7]).
- Structure_Names (str,optional) - The names of the structures to be shifted.
- Structure_Shift (arr,optional) - The magnitude of that the structures will be shifted. Note that at the moment the code will shift all structures defined by Structure_Names by the magnitude Structure_Shift.
- Oc-C1 (arr,optional) - The voxel corresponding to the Oc-C1 inter-vertebral joint. Format is [Sup/Inf,Ant/Post,L/R] (e.g. [100,229,258]). See the 'How to annotate the CT volume' section for details on how to get this voxel value.
- C1-C2 (arr,optional) - The voxel corresponding to the C1-C2 inter-vertebral joint. Format is [Sup/Inf,Ant/Post,L/R] (e.g. [100,229,258])
- C2-C3 (arr,optional) - The voxel corresponding to the C2-C3 inter-vertebral joint. Format is [Sup/Inf,Ant/Post,L/R] (e.g. [100,229,258])
- coordinates_cutoff (arr,optional) - The voxels corresponding to the anterior and posterior boundaries of the points on the neck halfway between the bottom of the chin and the top of the shoulders. Format is [ [Sup/Inf,Ant/Post,L/R] , [Sup/Inf,Ant/Post,L/R] ]. In future versions of this value this will be automatically calculated.
- [1,0,0] - Rotation around the SI axis (axial head rotation). +ve = head right , -ve = head left
- [0,1,0] - Rotation around the LR axis (head flexion/extension). +ve = head down, -ve = head up.
- [0,0,1] - Rotation around the AP axis (Lateral Head bending). +ve = head tilt right, -ve = head tilt left
- For a head rotation, the following optional variables need to be included: axes, angles, Oc-C1, C1-C2, C2-C3, coordinates_cutoff
- For a structure shift, the following optional variables need to be included: StructureDirectory, Structure_Names, Structure_Shift.
- If the number of values in the angles variable is > 1 then multiple head rotations will be performed in series (i.e. one after the other). The first rotation will be in the direction defined by the first array in the axes variable at the magnitude defined by the first variable in the angles variable and so on. The psuedocode for multiple head rotations is:
Dvf = []
for i = 0:len(angles)
axisLoop = axes[i]
anglesLoop = angles[i]
DVFLoop = Get_Head_Rotation_DVF(axisLoop,anglesLoop)
DVF = DVF + DVFLoop