Skip to content

Commit

Permalink
update/fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewang committed Nov 21, 2024
1 parent 9e398da commit d0b0696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/curation/filter_image_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}

FLAG_OVERWRITE = "--overwrite"
DEFAULT_DPATH_OUT = Path(__file__).parent.parent / "imaging_descriptions"
DEFAULT_DPATH_OUT = Path(__file__).parent.parent.parent / "imaging_descriptions"
DEFAULT_INDENT = 4


Expand Down
14 changes: 7 additions & 7 deletions scripts/dicom_reorg/fetch_dicom_downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def run_main(self):
# check if any image ID has already been downloaded
check_status = Parallel(n_jobs=self.n_jobs)(
delayed(_check_image_id)(
self.layout.dpath_raw_imaging
self.layout.dpath_pre_reorg
/ self.dicom_dir_map.get_dicom_dir(
participant_id=participant_id, session_id=self.session_id
),
Expand All @@ -164,27 +164,27 @@ def run_main(self):
[Manifest.col_participant_id, COL_IMAGE_ID]
].itertuples(index=False)
)
df_imaging_to_check[Doughnut.col_in_raw_imaging] = check_status
df_imaging_to_check[Doughnut.col_in_pre_reorg] = check_status

self.logger.info(
f"\tFound {int(df_imaging_to_check[Doughnut.col_in_raw_imaging].sum())} images already downloaded"
f"\tFound {int(df_imaging_to_check[Doughnut.col_in_pre_reorg].sum())} images already downloaded"
)
self.logger.info(
f"\tRemaining {int((~df_imaging_to_check[Doughnut.col_in_raw_imaging]).sum())} images need to be downloaded from LONI"
f"\tRemaining {int((~df_imaging_to_check[Doughnut.col_in_pre_reorg]).sum())} images need to be downloaded from LONI"
)

# update status file
participants_to_update = set(
df_imaging_to_check.loc[
df_imaging_to_check[Doughnut.col_in_raw_imaging],
df_imaging_to_check[Doughnut.col_in_pre_reorg],
Manifest.col_participant_id,
]
)
for participant_id in participants_to_update:
self.doughnut.set_status(
participant_id=participant_id,
session_id=self.session_id,
col=Doughnut.col_in_raw_imaging,
col=Doughnut.col_in_pre_reorg,
status=True,
)
self.logger.info(
Expand All @@ -194,7 +194,7 @@ def run_main(self):

# get images to download
image_ids_to_download = df_imaging_to_check.loc[
~df_imaging_to_check[Doughnut.col_in_raw_imaging],
~df_imaging_to_check[Doughnut.col_in_pre_reorg],
[Manifest.col_participant_id, COL_IMAGE_ID],
]
image_ids_to_download = image_ids_to_download.sort_values(
Expand Down

0 comments on commit d0b0696

Please sign in to comment.