Giter Site home page Giter Site logo

bibsnet-deprecated's Introduction

BIBSnet

DOI

Quickly and accurately segments an optimally-aligned T1 and T2 pair with a deep neural network trained via nnU-Net and SynthSeg with a large 0 to 8 month old infant MRI brain dataset. Please note that this only runs BIBSnet, not pre- or post-BIBSnet. These will eventually be rolled into the present repository.

Command-Line Arguments

usage: run.py [-h] --input INPUT --output OUTPUT [--nnUNet NNUNET]
  [--task TASK] [--model MODEL]

optional arguments:
  -h, --help            show this help message and exit
  --input INPUT, -i INPUT
                        Valid path to existing input directory following valid
                        nnU-Net naming conventions (T1w files end with
                        _0000.nii.gz and T2w end with _0001.nii.gz). There
                        should be exactly 1 T1w file and exactly 1 T2w file in
                        this directory.
  --output OUTPUT, -o OUTPUT
  --nnUNet NNUNET, -n NNUNET
                        Valid path to existing executable file to run nnU-
                        Net_predict. By default, this script will assume that
                        nnU-Net_predict will be in the same directory as this
                        script:
  --task TASK, -t TASK  Task ID, which should be a 3-digit positive integer
                        starting with 5 (e.g. 512).
--model MODEL, -m MODEL

Container

When running CABINET using a GPU, the job typically takes about 4 minutes, 2 tasks, and one node with 20 gb of memory to run effectively.

This has been primarily tested in Singularity. We are less able to provide technical support for Docker execution.

Singularity

Download

singularity pull docker://dcanumn/BIBSNet

Usage

singularity run --nv --cleanenv --no-home \
-B /path/to/input:/input \
-B /path/to/output:/output \
/path/to/BIBSNet.sif \
--input /input --output /output --task <task ID> --model 3d_fullres 

BIBSnet Segmentation Models

For choosing the model, be sure to choose the model according to what anatomicals you are providing. The task ID you provide with the --task flag needs to correlate with the model number.

data/models.csv lists all available BIBSnet models to run. Below are the default BIBSnet models, all trained on manually-segmented 0- to 8-month-old BCP subjects' segmentations.

Model Description
512 Model Used within BIBSNet manuscript
551 Default T1w and T2w model
514 Default T1w-only model
515 Default T2w-only model

Additionally, see the "location" column within data/models.csv to download the models. The models are publically available and can be pulled down with CLI tools such as wget. For example to pull down model 512 something like this work: wget https://s3.msi.umn.edu/CABINET_data/Task512_BCP_ABCD_Neonates_SynthSegDownsample.zip

Inputs

If you provide an input directory with both a T1w and a T2w, BIBSnet expects them to be aligned. If they are not aligned, the outputted segmentation will be inaccurate. It is also recommended to crop the input images just below the head to ensure the best results. Input files must be identified with _0000 and _0001 at the end of the file names for T1w and T2w, respectively (e.g. a T1w image needs to be named something like sub-XXX_ses-baseline_T1w_0000.nii.gz). If there is only one anatomical image, regardless of it being T1w or T2w, the file will need to be named with _0000 at the end. Pre-BIBSnet (usage here) performs each of these preprocessing steps. You will need to average images of the same anatomical file type if you have more than one T1w or T2w image.

Outputs

Outputs may need to be chirality corrected, which can be done with post-BIBSnet. The usage for post-BIBSnet can be found here. The outputs will be in the space that the anatomical was aligned with, i.e. if the T2w was aligned to the T1w, the output will be in T1w space and vice versa. If only one file type is inputted, the output will be in the space of that file.


bibsnet-deprecated's People

Contributors

lucimoore avatar tjhendrickson avatar gregconan avatar lundq163 avatar rosemccollum avatar audreymhoughton avatar

Watchers

James Cloos avatar Paul Reiners avatar  avatar  avatar Anders Perrone avatar  avatar D. Sturgeon avatar  avatar

Forkers

erikglee

bibsnet-deprecated's Issues

Where is nnUNet_predict

What happened?

Hi!

I want to segment T1w and T2w images of an infant using BIBSnet. I already followed the instruction for naming the files. I downloaded the package, and I used the following command:

python3 run.py --input /Users/p/Desktop/data --output /Users/p/Desktop/data/seg --task 512 --nnUNet ? --model 3d_fullres

Here is the error message:

run.py: error: argument --nnUNet/-n: Cannot read file at '/Users/p/Documents/BIBSnet/nnUNet_predict'

But I don't know where I can find "nnUNet_predict".

I have already downloaded the "3d_fullres" package, and I fetched the "nnUNet" from the GuitHub using the following code:

git clone https://github.com/MIC-DKFZ/nnUNet.git
cd nnUNet
pip install -e .

but it didn't solve the problem.

Would you please help me to solve this issue?

Thank you in advance,
Parinaz.

What command did you use?

python3 run.py --input /Users/p/Desktop/data --output /Users/p/Desktop/data/seg --task 512 --nnUNet ? --model 3d_fullres

What version of BIBSnet are you using?

main

Relevant log output

run.py: error: argument --nnUNet/-n: Cannot read file at '/Users/p/Documents/BIBSnet/nnUNet_predict'

Add any additional information or context about the problem here.

I have already downloaded the "3d_fullres" package, and I fetched the "nnUNet" from the GuitHub using the following code:

git clone https://github.com/MIC-DKFZ/nnUNet.git
cd nnUNet
pip install -e .

But it didn't solve the problem.

BIBSnet attempting to write a file (postprocessing.json) within the pretrained model folder in container

BIBSNet has this strange requirement where it wants to write a JSON file (postprocessing.json) into the container. The upside is that this does not prevent the segmentations from being created, however, I'm afraid that it could cause the pipeline to terminate if it is run non-interactively.
Traceback (most recent call last): File "/opt/conda/bin/nnUNet_predict", line 33, in <module> sys.exit(load_entry_point('nnunet', 'console_scripts', 'nnUNet_predict')()) File "/home/nnUNet/nnunet/inference/predict_simple.py", line 217, in main predict_from_folder(model_folder_name, input_folder, output_folder, folds, save_npz, num_threads_preprocessing, File "/home/nnUNet/nnunet/inference/predict.py", line 658, in predict_from_folder return predict_cases(model, list_of_lists[part_id::num_parts], output_files[part_id::num_parts], folds, File "/home/nnUNet/nnunet/inference/predict.py", line 277, in predict_cases shutil.copy(pp_file, os.path.abspath(os.path.dirname(output_filenames[0]))) File "/opt/conda/lib/python3.8/shutil.py", line 418, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "/opt/conda/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: PermissionError: [Errno 13] Permission denied: '/opt/nnUNet/nnUNet_raw_data_base/nnUNet_trained_models/nnUNet/3d_fullres/Task512_BCP_ABCD_Neonates_SynthSegDownsample/nnUNetTrainerV2__nnUNetPlansv2.1/postprocessing.json' Traceback (most recent call last): File "/home/bibsnet/run.py", line 178, in <module> main() File "/home/bibsnet/run.py", line 25, in main run_nnUNet_predict(cli_args) File "/home/bibsnet/run.py", line 39, in run_nnUNet_predict subprocess.check_call((cli_args["nnUNet"], File "/opt/conda/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '('/opt/conda/bin/nnUNet_predict', '-i', '/input', '-o', '/output', '-t', '512', '-m', '3d_fullres')' returned non-zero exit status 1.

Can't download singularity image

What happened?

Hi!

I want to pull the singularity image, but pulling is not finished successfully.

I would appreciate your help,
Parinaz.

What command did you use?

singularity pull docker://dcanumn/bibsnet

What version of BIBSnet are you using?

main

Relevant log output

parinazbabaeeghazvini@Parinazs-MacBook-Pro ~ % singularity pull docker://dcanumn/bibsnet
WARNING: Authentication token file not found : Only pulls of public images will succeed
INFO:    Starting build...
Getting image source signatures
Copying blob sha256:7b1a6ab2e44dbac178598dabe7cff59bd67233dba0b27e4fbd1f9d4b3c877a54
 27.24 MiB / 27.24 MiB [====================================================] 2s
Copying blob sha256:f0921041932afdd11dbb3f4f36139f419781278c16c7bb8ef7a6f87d67310683
 76.46 MiB / 76.46 MiB [====================================================] 4s
Copying blob sha256:94406cbfa47fb5e40152f5f60f17c1ce9856ce3626ef04bce3407708339c01b4
 86.05 MiB / 86.05 MiB [====================================================] 6s
Copying blob sha256:5f354d3e42536e566bbf3222ccd57c98a1a47a293d93ef2e8ed8b7c98547670c
 18.69 KiB / 18.69 KiB [====================================================] 0s
Copying blob sha256:64b085818b51b7ff2f66f508d4bdb426f039567c1c46103f9a0ad978f63361ec
 2.70 KiB / 2.70 KiB [======================================================] 0s
Copying blob sha256:59167b43742b5eca1394ff597ca62351478a8c786f41a80ca6cced29e1d84783
 3.96 KiB / 3.96 KiB [======================================================] 0s
Copying blob sha256:7944ee6bd7ea78d16326af292e844544002807dbee4fcc032aa5966e5c92b5c5
 145 B / 145 B [============================================================] 0s
Copying blob sha256:458b73cbc27bf28e94f43e42fdda3272e4b6b8c437427e7213c36a0a495190ad
 1.15 KiB / 1.15 KiB [======================================================] 0s
Copying blob sha256:55ace27f51e1e36c26843866f07a76b97e9e433760f4c85967f5730f53b8afd9
 394 B / 394 B [============================================================] 0s
Copying blob sha256:20dcc66b2ec9612d4f36f4cad107507582ff0d7281700cb2dc34f5d31440c4e2
 426 B / 426 B [============================================================] 0s
Copying blob sha256:72f1d84d206c004cb36b606ae1465eb27d115079457e95997dbde4c2a6c81554
 1.41 KiB / 1.41 KiB [======================================================] 0s
Copying blob sha256:79dde54ed7fdecae30373fe700508f52db4c3f947187357d5f8f6e1426d11bdc
 1.99 GiB / 1.99 GiB [====================================================] 2m0s
Copying blob sha256:659f7aa0c89526c3da891f23b2ddf84531d4ee2e0bb60fcac97c3fd746782cce
 11.28 KiB / 11.28 KiB [====================================================] 0s
Copying blob sha256:24b2591e2b77ac1f4001dfeebe3d280b6f22624bca012f4b14dd4a88e1cf220c
 187 B / 187 B [============================================================] 0s
Copying blob sha256:30627f4ced58f8a2d9c604743d881bbbf3f1060c7a4d15e6e579a76e1415935d
 168.67 KiB / 168.67 KiB [==================================================] 0s
Copying blob sha256:5cb052e99d7b9f86db1266d915f53c395cd364e45448d5624ac9e0b9ca8547b7
 730 B / 730 B [============================================================] 0s
Copying blob sha256:7b08cbb2fc1232d994166de2180b9c35f69453962b977ca975e8c3cca20cf73f
 4.90 KiB / 4.90 KiB [======================================================] 0s
Copying blob sha256:96fb1f568d24158c965f83d0620c95f8075f92b93f4d93be9019a635407b7b7f
 132.14 KiB / 132.14 KiB [==================================================] 0s
Copying blob sha256:79cf5ca01028046e742a20b417e587665b671460b9f700de521d86dbd97bca6e
 38.85 MiB / 38.85 MiB [====================================================] 2s
Copying blob sha256:942f2af9b4b4faa232aa2d1d70e7bb400659c959e881667a6fa7f112b79e2a24
 61.04 MiB / 61.04 MiB [====================================================] 4s
Copying blob sha256:d9a241dffeb9c5aff7aa9c4deac37c8448825b6d724210f8f511acea143b8a66
 508 B / 508 B [============================================================] 0s
Copying blob sha256:c2df6835b16c5c312ca7c09d0f508462ce763c9f2e96f394dd7f320a0c76a7cf
 298.06 MiB / 298.06 MiB [=================================================] 19s
Copying blob sha256:b6a847362fa0ff8a8c75ce129eb2d5dae464c157fe926ef99d523515e576e06f
 43.11 MiB / 43.11 MiB [====================================================] 3s
Copying blob sha256:12799c6b4e57c5aa49937fdc82f58c5d211723bf46147a576453b2ed324de344
 41.69 MiB / 41.69 MiB [====================================================] 2s
Copying blob sha256:909ad0dafda0a9632bf83249bbee1b88f67504144515de6a9b7105d7ea372eac
 515.96 MiB / 515.96 MiB [=================================================] 26s
Copying blob sha256:9403d1161e1a068d28e2aa04e443ee2da050e31ad50e12030bced24fb5bb335a
 1.08 MiB / 1.08 MiB [======================================================] 0s
Copying blob sha256:4989c1b69e4c4ed95b4bd644a1798b27187406afacae4f55d7ddac91e26f556d
 26.58 KiB / 26.58 KiB [====================================================] 0s
Copying blob sha256:86038a706467acc833fceee27c342c32419ff86fd885b5af227c0aeda05d65b4
 180.00 MiB / 180.00 MiB [==================================================] 9s
Copying blob sha256:54e3dfa0759b0a7c1669aa11e689c66dc521a4a51b7eb6e1e0a22359354a554d
 11.91 MiB / 11.91 MiB [====================================================] 1s
Copying blob sha256:97365d847b9c1bbdbc7e259450adacabb7955d16b478201882820afb2939e8a6
 67.23 MiB / 67.23 MiB [====================================================] 3s
Copying blob sha256:298c4275287699e0434f5c70cb8561f2a2579a3a3452072389c7ab85ecfd54b0
 16.72 MiB / 16.72 MiB [====================================================] 1s
Copying blob sha256:fb1088d76367c0b66da84142b8a9c7dbfb6da54103b76fa1bfb0c8d6ccd7d55b
 7.94 KiB / 7.94 KiB [======================================================] 0s
Copying blob sha256:b9365bcab9b7d44f144a070ebd885f1814fccb0465150870889b11e024c02715
 105.73 MiB / 105.73 MiB [==================================================] 5s
Copying blob sha256:8e88032d03c69c9045f38d7dff769b45c782beeb622155cbfb1566461de820f8
 474 B / 474 B [============================================================] 0s
Copying blob sha256:c3d86d557a858a1da056058c36d31781a0c057b050ab0485119b790b5dd2ecf4
 141.58 MiB / 141.58 MiB [==================================================] 7s
Copying blob sha256:60fa674fc74cef717284dd2bc7cfc72112c76525f055f4ac070c748ad718a886
 28.09 MiB / 28.09 MiB [====================================================] 3s
Copying blob sha256:03a0cceb7bdf44dad63e789e5d25c32f47e5728aa7946068be0dc664c5786aac
 9.96 KiB / 9.96 KiB [======================================================] 0s
Copying blob sha256:f295cba77df9486b0944078459481ab3258eb58852ee76379b70523e9f7d60c7
 891.07 MiB / 891.07 MiB [=================================================] 45s
Copying blob sha256:8afab37459a27a96e813d74eeb5fe997ae9d59afc7941d07e4d70d918894ebb8
 825.71 MiB / 825.71 MiB [=================================================] 39s
Copying blob sha256:f61d29988bdad0627eeafbac916fcb97a0d857a3701c44a3145613653b74359b
 4.69 MiB / 4.69 MiB [======================================================] 0s
Copying blob sha256:3f6f81fb92d20fd652e51d3ca26a7a162a6f35b2ab060d288f65ced20621b2e5
 1.11 KiB / 1.11 KiB [======================================================] 0s
Copying blob sha256:db29845091370c3a0bfb77d8edd8d8fbe6718c2414163a0f59fe1384b93076e7
 3.42 KiB / 3.42 KiB [======================================================] 0s
Copying blob sha256:40757caf8a5cd8e4b2451df7aa8255d54a78ac91d7bef1a915ea8c07d7ffd097
 63.34 MiB / 63.34 MiB [====================================================] 4s
Copying blob sha256:6ebedcc3d09a2d7e663a5bbac656e6503b7a3c2570234350ec40f658cda8e95d
 1.55 MiB / 1.55 MiB [======================================================] 0s
Copying blob sha256:33c52bd673aff465efb6eab924adee0f6c7f9eca06bca33d4be296e34b10313a
 972.21 MiB / 972.21 MiB [=================================================] 49s
Copying blob sha256:d71638515d4b03923693d5bfc5db7aaa1d167f8d19d03bfd4596642ec15680d3
 1.11 KiB / 1.11 KiB [======================================================] 0s
Copying blob sha256:9a3ffd2d753735decdbb3d4cf3010a02cccee757e1c3836f691f05d97bc8b2d6
 1.00 KiB / 1.00 KiB [======================================================] 0s
Copying blob sha256:b95879b6356349464daf591e06131bf75ea40e40ec7650eceec52b6fb2c74384
 6.45 MiB / 6.45 MiB [======================================================] 1s
Copying blob sha256:f27f8805630640fc46889aabece35e1eb6489f04cb91902dee79cb2b5eac0cba
 28.73 MiB / 28.73 MiB [====================================================] 2s
Copying blob sha256:b060fdcb998b176a17cb00ae8dde2fda7848b86f68ec03ce86fab8f9ba07cb5c
 35.32 MiB / 35.32 MiB [====================================================] 2s
Copying blob sha256:63b6eb395338155e2e833ba54615fcf6cd5c9d0792a36c2c884893cbac7586a5
 956.21 KiB / 956.21 KiB [==================================================] 0s
Copying blob sha256:e5714f9c02e5d84b4a29af4a930b58f10b20e49a23f0dae44cc7fce8eeb88b0f
 4.44 MiB / 4.44 MiB [======================================================] 0s
Copying blob sha256:3747a3df59888bbc4638bb94a9b5b672bbb7aac0e046d7b262064da45d760e8a
 16.39 MiB / 16.39 MiB [====================================================] 1s
Copying blob sha256:f249f8c5ea0110b7b82d7d213d909aa62cb7c508e1935176a2ec1f3b12695569
 28.63 MiB / 28.63 MiB [====================================================] 2s
Copying blob sha256:e7aa5cf0267062c26463582e52c3f4055a4638644886378a5e4476472f7fd06b
 10.52 MiB / 10.52 MiB [====================================================] 1s
Copying blob sha256:37e7d7f2efcf08ac127e7c8efcf802eb7e4a0d2b4fe03fe4cc346dc19e2f0ae8
 12.84 KiB / 12.84 KiB [====================================================] 0s
Copying blob sha256:5044637d92c8599d9fbc2ccb005104cc6e230ffe7187831d0850e2467884e270
 603 B / 603 B [============================================================] 0s
Copying blob sha256:321e7062ad4b52629675791091305412b013220b2f9c356ffe025d5c29f1e448
 270 B / 270 B [============================================================] 0s
Copying blob sha256:f4515b4a761ee666c21137ff40adb429bdc8a0c587a5b1e6bb885de5dbcc71cc
 79.24 MiB / 79.24 MiB [====================================================] 4s
Copying blob sha256:5ab84139626f851bd2b5c300554d87991abb60703754669b3c97ba461058b5ce
 4.30 KiB / 4.30 KiB [======================================================] 0s
Copying blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
 32 B / 32 B [==============================================================] 0s
Copying blob sha256:64042601843b53b985ae26110157b2b94a4af202cc49027060e2124637a7f388
 151.13 MiB / 151.13 MiB [==================================================] 9s
Skipping fetch of repeat blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
Copying blob sha256:6c66d20eb3c1d98000dfa1e7b6f4b7b657da4b2916775683af26947a337c090a
 4.27 GiB / 4.27 GiB [====================================================] 4m2s
Copying blob sha256:4043b4bd53662e608d738bbe11159fa736ad72ae40bcc9b344c9a8d4cd881110
 4.27 GiB / 4.27 GiB [===================================================] 3m33s
Copying blob sha256:476b151b151d951d4e7a9a723b15834d0c075cc7cb9c0a5ad17b10ccac943007
 3.10 KiB / 3.10 KiB [======================================================] 0s
Copying blob sha256:5def669263f04c6a3e773e60375d679a9ccf502843db602b6f0f0464259cd5e9
 3.09 KiB / 3.09 KiB [======================================================] 0s
Copying blob sha256:32e434ffa3079327a6d3dc5fd76503d3576252c97208068fd6507168ed287a43
 4.26 KiB / 4.26 KiB [======================================================] 0s
Copying config sha256:5e22dfc40c50c9de50e39e973db60efc3ab0db0c16b047fc53736ece68a47d6c
 51.83 KiB / 51.83 KiB [====================================================] 0s
Writing manifest to image destination
Storing signatures
FATAL:   Unable to pull docker://dcanumn/bibsnet: packer failed to pack: While unpacking tmpfs: unpack: error extracting layer: link /var/folders/dy/9095hyps7nd4pqh6_jjldt1h0000gn/T/sbuild-385127066/fs/opt/conda/pkgs/ncurses-6.2-h58526e2_4/share/terminfo/N/NCR260VT300WPP /var/folders/dy/9095hyps7nd4pqh6_jjldt1h0000gn/T/sbuild-385127066/fs/opt/conda/share/terminfo/N/NCR260VT300WPP: too many levels of symbolic links

Add any additional information or context about the problem here.

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.