Skip to content

Commit b5c2d35

Browse files
committed
add support for CHIRP data
1 parent c0b8063 commit b5c2d35

File tree

3 files changed

+49
-6
lines changed

3 files changed

+49
-6
lines changed

docs/trial_folder_structure/CHIRP.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.
2+
└── center/
3+
├── Patient Dose Files/
4+
│ └── Patient 1/
5+
│ └── files...
6+
├── Patient Planning CTs/
7+
│ └── Patient 1/
8+
│ └── Dicom Planning CT files...
9+
├── Patient Structure Sets/
10+
│ └── Patient 1/
11+
│ └── Dicom Structure files...
12+
├── Patient Plans/
13+
│ └── Patient 1/
14+
│ └── Dicom Plan files...
15+
├── Patient CBCT Images/
16+
│ └── Patient 1/
17+
│ ├── Fx1/
18+
│ │ └── Dicom CBCT Files...
19+
│ └── Fx2/
20+
│ └── Dicom CBCT Files...
21+
├── Couch Registration Files/
22+
│ └── Patient 1/
23+
│ ├── Fx1/
24+
│ │ └── Dicom Registration Files...
25+
│ └── Fx2/
26+
│ └── Dicom Registration Files...
27+
└── Patient Images/
28+
└── Patient 1/
29+
├── Fx1/
30+
│ ├── kV images
31+
│ └── Scan file
32+
└── Fx2/
33+
├── kV images
34+
└── Scan file

src/admin_console/DataImporter.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ def insertCHIRPDataIntoDatabase(self) -> Tuple[bool, str]:
376376
"patient_dose_files":"rt_dose_path",
377377
"patient_planning_cts":"rt_ct_path",
378378
"patient_structure_sets":"rt_structure_path",
379-
"patient_plans":"rt_plan_path"
379+
"patient_plans":"rt_plan_path",
380+
"patient_cbct_images":"dvh_track_path",
381+
"couch_registration_files":"metrics_path"
380382
}
381383
if self.fileInfo['level'] == "prescription":
382384
folderPath = self.fileInfo["folder_path"][0]
@@ -388,8 +390,15 @@ def insertCHIRPDataIntoDatabase(self) -> Tuple[bool, str]:
388390
self.markPacketAsImported()
389391
return True, "Success"
390392
elif self.fileInfo['level'] == "fraction":
391-
pass
392-
393+
for fraction in self.fileInfo["fraction"]:
394+
fractionDetail = self.dbAdapter.getFractionIdAndName(self.metadata["patient_trial_id"], fraction)
395+
if fractionDetail:
396+
fractionId = fractionDetail[0][0]
397+
folderPath = self.fileInfo['db_file_name'][fraction]
398+
queryStr = f"UPDATE images SET {dbTableMapping[fileType]} = \'{folderPath}\' WHERE fraction_id = \'{fractionId}\'"
399+
self.dbAdapter.executeUpdateOnImageDB(queryStr)
400+
self.markPacketAsImported()
401+
return True, "Success"
393402

394403
def prepareArgumentParser():
395404
argParser = argparse.ArgumentParser(description="data Importer Tool")

src/data_service/templates/upload_paths_template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"image_folder": "/{clinical_trial}/{test_centre}/Patient Images/Projection images/Patient {centre_patient_no}/",
2525
"trajectory_log_folder": "/{clinical_trial}/{test_centre}/Trajectory Logs/Patient {centre_patient_no}/",
2626
"patient_dose_files":"/{clinical_trial}/{test_centre}/Patient Dose Files/Patient {centre_patient_no}/",
27-
"patient_planning_cts":"/{clinical_trial}/{test_centre}/Patient Planning CTs/Patient {centre_patient_no}",
28-
"patient_structure_sets":"/{clinical_trial}/{test_centre}/Patient Structure Sets/Patient {centre_patient_no}",
29-
"patient_plans":"/{clinical_trial}/{test_centre}/Patient Plans/Patient {centre_patient_no}",
27+
"patient_planning_cts":"/{clinical_trial}/{test_centre}/Patient Planning CTs/Patient {centre_patient_no}/",
28+
"patient_structure_sets":"/{clinical_trial}/{test_centre}/Patient Structure Sets/Patient {centre_patient_no}/",
29+
"patient_plans":"/{clinical_trial}/{test_centre}/Patient Plans/Patient {centre_patient_no}/",
3030
"patient_cbct_images":"/{clinical_trial}/{test_centre}/Patient CBCT Images/Patient {centre_patient_no}/",
3131
"couch_registrations_files":"/{clinical_trial}/{test_centre}/Couch Registrations/Patient {centre_patient_no}/"
3232
}

0 commit comments

Comments
 (0)