Skip to content

Commit

Permalink
merge master into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Aug 23, 2023
2 parents 94ce896 + 87560f3 commit 7133317
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Overview of [improvements](resources/improvements_in_v2.md) in TotalSegmentator
![Alt text](resources/imgs/overview_classes.png)

Created by the department of [Research and Analysis at University Hospital Basel](https://www.unispital-basel.ch/en/radiologie-nuklearmedizin/forschung-radiologie-nuklearmedizin).
If you use it please cite our paper: [https://arxiv.org/abs/2208.05868](https://arxiv.org/abs/2208.05868). Please also cite [nnUNet](https://github.com/MIC-DKFZ/nnUNet) since TotalSegmentator is heavily based on it.
If you use it please cite our [Radiology AI paper](https://pubs.rsna.org/doi/10.1148/ryai.230024). Please also cite [nnUNet](https://github.com/MIC-DKFZ/nnUNet) since TotalSegmentator is heavily based on it.


### Installation
Expand Down Expand Up @@ -158,10 +158,10 @@ TotalSegmentator (starting in v1.5.4) sends anonymous usage statistics to help u


### Reference
For more details see this paper [https://arxiv.org/abs/2208.05868](https://arxiv.org/abs/2208.05868).
For more details see our [Radiology AI paper](https://pubs.rsna.org/doi/10.1148/ryai.230024) ([freely available preprint](https://arxiv.org/abs/2208.05868)).
If you use this tool please cite it as follows
```
Wasserthal J., Meyer M., Breit H., Cyriac J., Yang S., Segeroth M. TotalSegmentator: robust segmentation of 104 anatomical structures in CT images, 2022. URL: https://arxiv.org/abs/2208.05868. arXiv: 2208.05868
Wasserthal, J., Breit, H.-C., Meyer, M.T., Pradella, M., Hinck, D., Sauter, A.W., Heye, T., Boll, D., Cyriac, J., Yang, S., Bach, M., Segeroth, M., 2023. TotalSegmentator: Robust Segmentation of 104 Anatomic Structures in CT Images. Radiology: Artificial Intelligence. https://doi.org/10.1148/ryai.230024
```
Please also cite [nnUNet](https://github.com/MIC-DKFZ/nnUNet) since TotalSegmentator is heavily based on it.
Moreover, we would really appreciate if you let us know what you are using this tool for. You can also tell us what classes we should add in future releases. You can do so [here](https://github.com/wasserth/TotalSegmentator/issues/1).
Expand Down
2 changes: 1 addition & 1 deletion bin/TotalSegmentator
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from totalsegmentator.python_api import totalsegmentator

def main():
parser = argparse.ArgumentParser(description="Segment 104 anatomical structures in CT images.",
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://arxiv.org/abs/2208.05868")
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://pubs.rsna.org/doi/10.1148/ryai.230024")

parser.add_argument("-i", metavar="filepath", dest="input",
help="CT nifti image or folder of dicom slices",
Expand Down
2 changes: 1 addition & 1 deletion bin/crop_to_body
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from totalsegmentator.cropping import crop_to_mask, undo_crop

def main():
parser = argparse.ArgumentParser(description="Crop input image to body.",
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://arxiv.org/abs/2208.05868")
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://pubs.rsna.org/doi/10.1148/ryai.230024")

parser.add_argument("-i", metavar="filepath", dest="input",
help="CT nifti image",
Expand Down
2 changes: 1 addition & 1 deletion bin/totalseg_combine_masks
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if __name__ == "__main__":
totalseg_combine_masks -i totalsegmentator_output_dir -o combined_mask.nii.gz -m lung
"""
parser = argparse.ArgumentParser(description="Combine masks.",
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://arxiv.org/abs/2208.05868")
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://pubs.rsna.org/doi/10.1148/ryai.230024")

parser.add_argument("-i", metavar="directory", dest="mask_dir",
help="TotalSegmentator output directory containing all the masks",
Expand Down
4 changes: 3 additions & 1 deletion bin/totalseg_download_weights
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from pathlib import Path
import argparse

from totalsegmentator.libs import download_pretrained_weights

from totalsegmentator.config import setup_totalseg

if __name__ == "__main__":
"""
Expand Down Expand Up @@ -33,6 +33,8 @@ if __name__ == "__main__":
"liver_vessels": [8]
}

setup_totalseg()

for task_id in task_to_id[args.task]:
print(f"Processing {task_id}...")
download_pretrained_weights(task_id)
2 changes: 1 addition & 1 deletion bin/totalseg_setup_manually
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if __name__ == "__main__":
totalseg_setup_manually -id totalseg_12345678
"""
parser = argparse.ArgumentParser(description="Combine masks.",
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://arxiv.org/abs/2208.05868")
epilog="Written by Jakob Wasserthal. If you use this tool please cite https://pubs.rsna.org/doi/10.1148/ryai.230024")

parser.add_argument("-id", "--totalseg_id", type=str, help="totalseg_id. Must start with totalseg_.",
required=True)
Expand Down
2 changes: 1 addition & 1 deletion totalsegmentator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_version():


def send_usage_stats(config, params):
if config["send_usage_stats"]:
if config is not None and config["send_usage_stats"]:

params["roi_subset"] = "" if params["roi_subset"] is None else "-".join(params["roi_subset"])

Expand Down
2 changes: 1 addition & 1 deletion totalsegmentator/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def totalsegmentator(input, output, ml=False, nr_thr_resamp=1, nr_thr_saving=6,
nora_tag = "None" if nora_tag is None else nora_tag

if not quiet:
print("\nIf you use this tool please cite: https://doi.org/10.48550/arXiv.2208.05868\n")
print("\nIf you use this tool please cite: https://pubs.rsna.org/doi/10.1148/ryai.230024\n")

if not torch.cuda.is_available():
print("No GPU detected. Running on CPU. This can be very slow. The '--fast' option can help to some extend.")
Expand Down

0 comments on commit 7133317

Please sign in to comment.