From be1a68f465bfe45a10edcb0cbc08e171370e9ae0 Mon Sep 17 00:00:00 2001 From: wasserth Date: Thu, 21 Mar 2024 11:19:40 +0100 Subject: [PATCH] update readme --- README.md | 2 +- totalsegmentator/bin/TotalSegmentator.py | 2 +- totalsegmentator/nnunet.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5574f1b1c..a4bee0860 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ If you want to reduce memory consumption you can use the following options: * `--fast`: This will use a lower-resolution model * `--body_seg`: This will crop the image to the body region before processing it * `--roi_subset `: This will only predict a subset of classes -* `--force_split`: This will split the image into 3 parts and process them one after another +* `--force_split`: This will split the image into 3 parts and process them one after another. (Do not use this for small images. Splitting these into even smaller images will result in a field of view which is too small.) * `--nr_thr_saving 1`: Saving big images with several threads will take a lot of memory diff --git a/totalsegmentator/bin/TotalSegmentator.py b/totalsegmentator/bin/TotalSegmentator.py index aff94b4dc..625b53525 100644 --- a/totalsegmentator/bin/TotalSegmentator.py +++ b/totalsegmentator/bin/TotalSegmentator.py @@ -84,7 +84,7 @@ def main(): help="Do initial rough body segmentation and crop image to body region", default=False) - parser.add_argument("-fs", "--force_split", action="store_true", help="Process image in 3 chunks for less memory consumption", + parser.add_argument("-fs", "--force_split", action="store_true", help="Process image in 3 chunks for less memory consumption. (do not use on small images)", default=False) parser.add_argument("-ss", "--skip_saving", action="store_true", diff --git a/totalsegmentator/nnunet.py b/totalsegmentator/nnunet.py index dc0c8bc06..7732c7073 100644 --- a/totalsegmentator/nnunet.py +++ b/totalsegmentator/nnunet.py @@ -321,6 +321,9 @@ def nnUNet_predict_image(file_in: Union[str, Path, Nifti1Image], file_out, task_ dcm_to_nifti(file_in, tmp_dir / "dcm" / "converted_dcm.nii.gz", verbose=verbose) file_in_dcm = file_in file_in = tmp_dir / "dcm" / "converted_dcm.nii.gz" + + # for debugging + # shutil.copy(file_in, file_in_dcm.parent / "converted_dcm_TMP.nii.gz") # Workaround to be able to access file_in on windows (see issue #106) # if platform.system() == "Windows":