diff --git a/NiChart_DLMUSE/CalcROIVol.py b/NiChart_DLMUSE/CalcROIVol.py index 9e1e1b5..6910ce6 100644 --- a/NiChart_DLMUSE/CalcROIVol.py +++ b/NiChart_DLMUSE/CalcROIVol.py @@ -109,6 +109,17 @@ def create_roi_csv( ) -> None: """ Creates a csv file with the results of the roi calculations + + :param mrid: the input mrid + :type mrid: Any + :param in_roi: the input ROI + :type in_roi: Any + :param map_derived_roi: derived roi map file + :type map_derived_roi: Any + :param out_csv: output csv filename + :type out_csv: str + + :rtype: None """ # Calculate MUSE ROIs @@ -140,6 +151,19 @@ def apply_create_roi_csv( ) -> None: """ Apply roi volume calc to all images + + :param df_img: the passed dataframe + :type df_img: pd.DataFrame + :param in_dir: the input directory + :type in_dir: str + :param in_suff: the input suffix + :type in_suff: str + :param out_dir: the output directory + :type out_dir: str + :param out_suff: the output suffix + :type out_suff: str + + :rtype: None """ if not os.path.exists(out_dir): os.makedirs(out_dir) @@ -158,6 +182,19 @@ def combine_roi_csv( ) -> None: """ Combine csv files + + :param df_img: passed dataframe + :type df_img: pd.DataFrame + :param in_dir: the input directory + :type in_dir: str + :param in_suff: the input suffix + :type in_suff: str + :param out_dir: the output directory + :type out_dir: str + :param out_name: the desired output filename + :type out_name: str + + :rtype: None """ if not os.path.exists(out_dir): os.makedirs(out_dir) diff --git a/NiChart_DLMUSE/SegmentImage.py b/NiChart_DLMUSE/SegmentImage.py index 14e6ef4..90b9adc 100644 --- a/NiChart_DLMUSE/SegmentImage.py +++ b/NiChart_DLMUSE/SegmentImage.py @@ -6,12 +6,30 @@ def run_dlicv( in_dir: str, - in_suff: Any, + in_suff: str, out_dir: str, - out_suff: Any, + out_suff: str, device: str, extra_args: str = "", ) -> None: + """ + Run dlicv with the passed images + + :param in_dir: the input directory + :type in_dir: str + :param in_suff: the input suffix + :type in_suff: str + :param out_dir: the output directory + :type out_dir: str + :param out_suff: the output suffix + :type out_suff: str + :param device: cuda/mps for GPU acceleration otherwise cpu + :type device: str + :param extra_args: extra arguments for DLICV package + :type extra_args: str + + :rtype: None + """ # Call DLICV os.system(f"DLICV -i {in_dir} -o {out_dir} -device {device} " + extra_args) @@ -28,6 +46,24 @@ def run_dlmuse( device: str, extra_args: str = "", ) -> None: + """ + Run dlmuse with the passed images + + :param in_dir: the input directory + :type in_dir: str + :param in_suff: the input suffix + :type in_suff: str + :param out_dir: the output directory + :type out_dir: str + :param out_suff: the output suffix + :type out_suff: str + :param device: cuda/mps for GPU acceleration otherwise cpu + :type device: str + :param extra_args: extra arguments for DLMUSE package + :type extra_args: str + + :rtype: None + """ # Call DLMUSE os.system(f"DLMUSE -i {in_dir} -o {out_dir} -device {device} " + extra_args) diff --git a/NiChart_DLMUSE/dlmuse_pipeline.py b/NiChart_DLMUSE/dlmuse_pipeline.py index a498c16..b533937 100644 --- a/NiChart_DLMUSE/dlmuse_pipeline.py +++ b/NiChart_DLMUSE/dlmuse_pipeline.py @@ -45,6 +45,21 @@ def run_pipeline( ) -> None: """ NiChart pipeline + + :param in_data: the input directory + :type in_data: str + :param out_dir: the output directory + :type out_dir: str + :param device: conda/mps for GPU acceleration otherwise cpu + :type device: str + :param dlmuse_extra_args: extra arguments for DLMUSE package + :type dlmuse_extra_args: str + :param dlicv_extra_args: extra arguments for DLICV package + :type dlicv_extra_args: str + :param sub_fldr: the number of subfolders(default = 1) + :type sub_fldr: int + + :rtype: None """ logging.info(f"Starting the pipeline on folder {sub_fldr}") logging.info(f"Detecting input images for batch [{sub_fldr}]...")