diff --git a/README.md b/README.md index b6035459a..a1e4a94d5 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ TotalSegmentator -i ct.nii.gz -o segmentations -ta lung_vessels ``` Overview of available subtasks and the classes which they contain. -Openly available: +Openly available for any usage: * **lung_vessels**: lung_vessels (cite [paper](https://www.sciencedirect.com/science/article/pii/S0720048X22001097)), lung_trachea_bronchia * **cerebral_bleed**: intracerebral_hemorrhage (cite [paper](https://www.mdpi.com/2077-0383/12/7/2631)) * **hip_implant**: hip_implant @@ -75,12 +75,12 @@ Openly available: * **body**: body, body_trunc, body_extremities, skin * **pleural_pericard_effusion**: pleural_effusion (cite [paper](http://dx.doi.org/10.1097/RLI.0000000000000869)), pericardial_effusion (cite [paper](http://dx.doi.org/10.3390/diagnostics12051045)) -Available after purchase of a license (free licenses possible for academic projects). Contact jakob.wasserthal@usb.ch if you are interested: -* **bones_extremities**: femur, patella, tibia, fibula, tarsal, metatarsal, phalanges_feet, humerus, ulna, radius, carpal, metacarpal, phalanges_hand, sternum, skull, spinal_cord +Available with a license. Free licenses available for non-commercial usage [here](https://backend.totalsegmentator.com/license-academic/). For a commercial license contact jakob.wasserthal@usb.ch. +* **heartchambers_highres**: myocardium, atrium_left, ventricle_left, atrium_right, ventricle_right, aorta, pulmonary_artery (trained on sub-millimeter resolution) +* **appendicular_bones**: patella, tibia, fibula, tarsal, metatarsal, phalanges_feet, ulna, radius, carpal, metacarpal, phalanges_hand * **tissue_types**: subcutaneous_fat, skeletal_muscle, torso_fat -* **heartchambers_highres**: myocardium, atrium_left, ventricle_left, atrium_right, ventricle_right, aorta, pulmonary_artery (more precise heart chamber segmentation, trained on sub-millimeter resolution) -* **head**: mandible, teeth, brainstem, subarachnoid_cavity, venous_sinuses, septum_pellucidum, cerebellum, caudate_nucleus, lentiform_nucleus, insular_cortex, internal_capsule, ventricle, central_sulcus, frontal_lobe, parietal_lobe, occipital_lobe, temporal_lobe, thalamus, tyroid (trained on sub-millimeter resolution) -* **aortic_branches**: brachiocephalic_trunc, subclavian_artery_right, subclavian_artery_left, common_carotid_artery_right, common_carotid_artery_left, brachiocephalic_vein_left, brachiocephalic_vein_right, atrial_appendage_left, superior_vena_cava, pulmunary_vein, tyroid +* **face**: face_region + ### Run via docker diff --git a/bin/totalseg_set_license b/bin/totalseg_set_license new file mode 100644 index 000000000..ce3402645 --- /dev/null +++ b/bin/totalseg_set_license @@ -0,0 +1,30 @@ +#!/usr/bin/env python +import sys +from pathlib import Path +import argparse + +from totalsegmentator.config import setup_totalseg, set_license_number + + +if __name__ == "__main__": + """ + Set your totalsegmentator license number + + Usage: + totalseg_set_license -l aca_12345678910 + """ + parser = argparse.ArgumentParser(description="Set license.", + epilog="Written by Jakob Wasserthal. If you use this tool please cite https://pubs.rsna.org/doi/10.1148/ryai.230024") + + parser.add_argument("-l", "--license_number", type=str, help="TotalSegmentator license number.", + required=True) + + args = parser.parse_args() + + if not args.license_number.startswith("aca_"): + raise ValueError("license number must start with 'aca_' or 'com_' ") + if len(args.license_number) != 18: + raise ValueError("license number must have exactly 18 characters.") + + setup_totalseg() # create config file if not exists + set_license_number(args.license_number) diff --git a/setup.py b/setup.py index b2bbb3c49..32fe1ac81 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,6 @@ scripts=[ 'bin/TotalSegmentator', 'bin/totalseg_combine_masks', 'bin/crop_to_body', 'bin/totalseg_import_weights', 'bin/totalseg_download_weights', - 'bin/totalseg_setup_manually' + 'bin/totalseg_setup_manually', 'bin/totalseg_set_license' ] ) diff --git a/totalsegmentator/python_api.py b/totalsegmentator/python_api.py index 010d00bdf..ec477ef07 100644 --- a/totalsegmentator/python_api.py +++ b/totalsegmentator/python_api.py @@ -22,12 +22,11 @@ def show_license_info(): # textwarp needed to remove the indentation of the multiline string print(textwrap.dedent("""\ In contrast to the other tasks this task is not openly available. - It requires a license. For academic usage a free license can be + It requires a license. For non-commercial usage a free license can be acquired here: - https://totalsegmentator-academic.streamlit.app + https://backend.totalsegmentator.com/license-academic/ - For commercial usage see: - https://totalsegmentator-commercial.streamlit.app + For commercial usage contact: jakob.wasserthal@usb.ch """)) sys.exit(1) elif status == "invalid_license":