Javier Pérez de Frutos
commited on
Commit
·
d479416
1
Parent(s):
188227a
Updated README
Browse filesAdded extension to vessel_segementer
Added unit test for extension .nii.gz
- .github/workflows/build.yml +6 -2
- README.md +1 -1
- livermask/utils/process.py +3 -3
.github/workflows/build.yml
CHANGED
@@ -70,12 +70,16 @@ jobs:
|
|
70 |
mkdir samples
|
71 |
cd samples
|
72 |
gdown https://drive.google.com/uc?id=1shjSrFjS4PHE5sTku30PZTLPZpGu24o3
|
73 |
-
gdown https://drive.google.com/uc?id=
|
74 |
|
75 |
-
- name: Test inference
|
76 |
run: |
|
77 |
livermask --input samples --output samples --verbose --vessels
|
78 |
|
|
|
|
|
|
|
|
|
79 |
conda:
|
80 |
needs: build
|
81 |
runs-on: ${{ matrix.os }}
|
|
|
70 |
mkdir samples
|
71 |
cd samples
|
72 |
gdown https://drive.google.com/uc?id=1shjSrFjS4PHE5sTku30PZTLPZpGu24o3
|
73 |
+
gdown https://drive.google.com/uc?id=1oID3MyN3hjVWF_cfKJg1oL37p7GrvVUh
|
74 |
|
75 |
+
- name: Test inference .nii
|
76 |
run: |
|
77 |
livermask --input samples --output samples --verbose --vessels
|
78 |
|
79 |
+
- name: Test inference .nii.gz
|
80 |
+
run: |
|
81 |
+
livermask --input samples --output samples --verbose --vessels --extension .nii.gz
|
82 |
+
|
83 |
conda:
|
84 |
needs: build
|
85 |
runs-on: ${{ matrix.os }}
|
README.md
CHANGED
@@ -61,7 +61,7 @@ python -m livermask.livermask --input path-to-input --output path-to-output
|
|
61 |
```
|
62 |
|
63 |
## DICOM/NIfTI format
|
64 |
-
Pipeline assumes input is in the NIfTI format, and output a binary volume in the same format (.nii).
|
65 |
DICOM can be converted to NIfTI using the CLI [dcm2niix](https://github.com/rordenlab/dcm2niix), as such:
|
66 |
```
|
67 |
dcm2niix -s y -m y -d 1 "path_to_CT_folder" "output_name"
|
|
|
61 |
```
|
62 |
|
63 |
## DICOM/NIfTI format
|
64 |
+
Pipeline assumes input is in the NIfTI format, and output a binary volume in the same format (.nii or .nii.gz).
|
65 |
DICOM can be converted to NIfTI using the CLI [dcm2niix](https://github.com/rordenlab/dcm2niix), as such:
|
66 |
```
|
67 |
dcm2niix -s y -m y -d 1 "path_to_CT_folder" "output_name"
|
livermask/utils/process.py
CHANGED
@@ -132,7 +132,7 @@ def liver_segmenter(params):
|
|
132 |
raise "Caught KeyboardInterrupt, terminating worker"
|
133 |
|
134 |
|
135 |
-
def vessel_segmenter(curr, output, cpu, verbose, multiple_flag, liver_mask, name_vessel):
|
136 |
# check if cupy is available, if not, set cpu=True
|
137 |
try:
|
138 |
import cupy
|
@@ -226,6 +226,6 @@ def vessel_segmenter(curr, output, cpu, verbose, multiple_flag, liver_mask, name
|
|
226 |
img = nib.Nifti1Image(pred, affine=resampled_volume.affine)
|
227 |
resampled_lab = resample_from_to(img, nib_volume, order=0)
|
228 |
if multiple_flag:
|
229 |
-
nib.save(resampled_lab, output + "/" + curr.split("/")[-1].split(".")[0] + "-vessels
|
230 |
else:
|
231 |
-
nib.save(resampled_lab, output + "-vessels
|
|
|
132 |
raise "Caught KeyboardInterrupt, terminating worker"
|
133 |
|
134 |
|
135 |
+
def vessel_segmenter(curr, output, cpu, verbose, multiple_flag, liver_mask, name_vessel, extension):
|
136 |
# check if cupy is available, if not, set cpu=True
|
137 |
try:
|
138 |
import cupy
|
|
|
226 |
img = nib.Nifti1Image(pred, affine=resampled_volume.affine)
|
227 |
resampled_lab = resample_from_to(img, nib_volume, order=0)
|
228 |
if multiple_flag:
|
229 |
+
nib.save(resampled_lab, output + "/" + curr.split("/")[-1].split(".")[0] + "-vessels" + extension)
|
230 |
else:
|
231 |
+
nib.save(resampled_lab, output + "-vessels" + extension)
|