From d0743b19ae4a086d8d6bc57f897af2850766312b Mon Sep 17 00:00:00 2001 From: Paul Yushkevich Date: Thu, 5 Dec 2024 13:32:43 -0500 Subject: [PATCH 1/4] Update README.md --- README.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b0c2f64..e959644 100644 --- a/README.md +++ b/README.md @@ -62,16 +62,19 @@ CRASHS offers different templates for different ASHS versions. Currently, the fo * **ashs_pmc_alveus**: Template for the high-resolution oblique coronal T2-weighted MRI version of [ASHS](https://doi.org/10.1002/hbm.22627). This template should be used with the **ASHS PMC** atlas. The white matter label will be added to the existing segmentation and extended synthetically over the alveus/fimbria, as described in our [ADNI 20th anniversary paper](https://doi.org/10.1002/alz.14161). -## Running CRASHS on a sample dataset (Docker) +## Running CRASHS on a sample dataset -An example segmentation using T1-ASHS is provided in the folder `sample_data`. It can be used to test CRASHS. +A sample dataset is included in the `sample_data` folder in the repository. Download it to some folder on your system (we will use `/my/crashs/folder/sample_data` for this tutorial). -If using Docker, run the following command to open a command prompt on the container. Be sure to adjust paths `your_output_directory` and `/my/crashs/folder/crashs_template_package_20240830` to match your system. These paths will be mapped to paths `/data` and `/package` in the container. +### Instructions for Docker + +If using Docker, run the following command to open a command prompt on the container (change `/my/crashs/folder` to the right folder). ```sh docker run \ -v your_output_directory:/data \ -v /my/crashs/folder/crashs_template_package_20240830:/package \ + -v /my/crashs/folder/sample_data:/data \ -it pyushkevich/crashs:latest /bin/bash ``` @@ -80,22 +83,24 @@ Run this command inside of the container to run CRASHS on the example T1-ASHS se ```sh python3 -m crashs fit \ -C /package -s right -c corr_usegray \ - sample_data/035_S_4082_2011-06-28 ashs_pmc_t1 /data/035_S_4082_2011-06-28 + /sample_data/ashs_pmc_t1/subj01/ashs ashs_pmc_t1 /sample_data/ashs_pmc_t1/subj01/crashs ``` -You should find the output from running CRASHS in folder `your_output_directory/035_S_4082_2011-06-28` on your system. +You should find the output from running CRASHS in folder `/my/crashs/folder/sample_data/ashs_pmc_t1/subj01` on your system. -## Running CRASHS on a sample dataset (pip install) +### Instructions for `pip` install -If using CRASHS installed with `pip`, download the dataset from the `sample_data` folder in this repository to some location on your system, call it `your_input_dir`. Create an output directory, `your_output_dir`. Make sure the `CRASHS_DATA` environment variable has been set as explained above. Then you can run CRASHS on the sample dataset as follows: +If using CRASHS installed with `pip` and the `CRASHS_DATA` environment variable has been set as explained above, use the command below to run CRASHS on the on the example T1-ASHS segmentation: ```sh python3 -m crashs fit \ -s right -c corr_usegray \ - your_input_dir/035_S_4082_2011-06-28 ashs_pmc_t1 your_output_dir/035_S_4082_2011-06-28 + /my/crashs/folder/sample_data/ashs_pmc_t1/subj01/ashs \ + ashs_pmc_t1 \ + /my/crashs/folder/sample_data/ashs_pmc_t1/subj01/crashs ``` -You should find the output from running CRASHS in folder `your_output_dir/035_S_4082_2011-06-28`. +You should find the output from running CRASHS in folder `/my/crashs/folder/sample_data/ashs_pmc_t1/subj01/crashs`. ## Outputs from CRASHS The program generates many outputs, but the most useful ones are: From 3a871b7263c4387cef2062012781ca45000f0d1f Mon Sep 17 00:00:00 2001 From: Paul Yushkevich Date: Thu, 5 Dec 2024 14:31:11 -0500 Subject: [PATCH 2/4] Update pyproject.toml Fixed a couple missing requirements --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4a8fb78..3b24e52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,9 @@ dependencies = [ 'picsl_c3d>=1.4.2.1', 'picsl_greedy>=0.0.5', 'picsl_cmrep>=1.0.2.0', - 'nnunetv2' + 'nnunetv2', + 'acvl_utils==0.2', + 'blosc2' ] readme = "README.md" requires-python = ">=3.8" From 37fbd3a9763d26d856fd384bcf88ad3d876592cc Mon Sep 17 00:00:00 2001 From: Paul Yushkevich Date: Thu, 5 Dec 2024 14:31:51 -0500 Subject: [PATCH 3/4] Version bump to 0.2.7 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b24e52..e14061a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "crashs" -version = "0.2.6" +version = "0.2.7" authors = [ { name="Paul Yushkevich", email="pyushkevich@gmail.com" }, ] From a06cf3ab49f737c8a73bfd62b4dcbe596204ea7d Mon Sep 17 00:00:00 2001 From: Paul Yushkevich Date: Thu, 5 Dec 2024 14:45:09 -0500 Subject: [PATCH 4/4] Documentation update with T2 example --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index e959644..11c7eb5 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,28 @@ python3 -m crashs fit \ You should find the output from running CRASHS in folder `/my/crashs/folder/sample_data/ashs_pmc_t1/subj01/crashs`. +### T2 Example + +Another example in the `sample_data` folder can be used to test CRASHS for T2-weighted MRI processed with the ASHS-PMC atlas. It is better to run this example on a machine with an NVidia GPU because a nnU-Net is used by CRASHS to generate the white matter label; otherwise expect it to take 30-60 minutes to complete. If using Docker, include the flag `--gpus all` when calling the `docker run` command to make the GPU available to the container. + +You can run the example in the Docker container like this: + +```sh +python3 -m crashs fit -C /package -s left -c heur \ + /data/ashs_pmc_alveus/subj02/ashs \ + ashs_pmc_alveus \ + /data/ashs_pmc_alveus/subj02/crashs +``` + +Or using CRASHS pip install like this: + +```sh +python3 -m crashs fit -s left -c heur \ + /my/crashs/folder/sample_data/ashs_pmc_alveus/subj02/ashs \ + ashs_pmc_alveus \ + /my/crashs/folder/sample_data/ashs_pmc_alveus/subj02/crashs +``` + ## Outputs from CRASHS The program generates many outputs, but the most useful ones are: * `fitting/[ID]_fitted_omt_hw_target.vtk`: the grey/white and grey/csf boundaries estimated by the `cruise_cortex_extraction` module of NighRes. These meshes are in physical (RAS) coordinate space, not in voxel (IJK) space output by Nighres. *If you extract meshes from the T1-ASHS segmentation in ITK-SNAP, those should line up with these meshes.*