Skip to content

Testing inference on whole volume #12

@jcohenadad

Description

@jcohenadad

Copy 3D volume to folder:

mkdir data_test
cp ${PATH_DATA}/sub-01/anat/sub-01_part-mag_chunk-02_T2starw.nii.gz data_test
cd data_test

Need to split it:

sct_image -i sub-01_part-mag_chunk-02_T2starw.nii.gz -split y 

Then add _0000 as required by nnUNet:

for file in *.nii.gz; do
  base="${file%.nii.gz}"
  mv "$file" "${base}_0000.nii.gz"
done

Run inference:

cd ..
nnUNetv2_predict -i test_set2 -o test_set2_predictions -d 502 -c 2d -f 0 -tr nnUNetTrainerWandb -chk checkpoint_best.pth -device mps

Note

nnUNet stacks it back to a 3D volume 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions