Skip to content

Commit

Permalink
Merge branch 'pride-svr-0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaroberts committed Apr 6, 2022
2 parents e34261f + 9c78a32 commit ab5bff7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Minimum hardware requirements:
- CPU with 6 cores
- 16 GB RAM
- For GPU-accelerated reconstruction: Nvidia GPU with 12GB video memory
- At least 30GB free disk space
- At least 30GB free disk space

Recommended hardware requirements:
- CPU with ≥10 cores
Expand Down Expand Up @@ -58,12 +58,12 @@ git clone --recurse-submodules https://github.com/SVRTK/svrtk-docker-gpu.git /ho
### Option 1 --- Install using pre-built Docker image
#### 1.1 Download the pre-built Docker image from DockerHub:
```
docker pull fetalsvrtk/svrtk:svrtk-docker-gpu-0.10
docker pull fetalsvrtk/svrtk:pride-svr-docker-0.2.0
```
#### 1.2 Test the Docker container is working:

```
docker run -it fetalsvrtk/svrtk:svrtk-docker-gpu-0.10
docker run -it fetalsvrtk/svrtk:pride-svr-docker-0.2.0
```
Once inside the container, test MIRTK is working by running:

Expand Down Expand Up @@ -96,13 +96,13 @@ wget https://gin.g-node.org/SVRTK/fetal_mri_network_weights/raw/master/checkpoin
#### 2.3 Build the container using the Dockerfile:

```
docker build -f svrtk-docker-gpu.Dockerfile -t fetalsvrtk/svrtk:svrtk-docker-gpu-0.10 .
docker build -f svrtk-docker-gpu.Dockerfile -t fetalsvrtk/svrtk:pride-svr-docker-0.2.0 .
```

#### 2.4 Test the Docker container is working:

```
docker run -it fetalsvrtk/svrtk:svrtk-docker-gpu-0.10
docker run -it fetalsvrtk/svrtk:pride-svr-docker-0.2.0
```
Once inside the container, test MIRTK is working by running:

Expand All @@ -122,7 +122,7 @@ Copy nifti files (labelled `stack1.nii.gz`, `stack2.nii.gz`, ... `stackN.nii.gz`
Then:

```
docker run -v "svrtk-docker-gpu/recon":/home/recon fetalsvrtk/svrtk:svrtk-docker-gpu-0.10 /home/scripts/docker-recon-brain-auto.bash /home/recon
docker run -v "svrtk-docker-gpu/recon":/home/recon fetalsvrtk/svrtk:pride-svr-docker-0.2.0 /home/scripts/docker-recon-brain-auto.bash /home/recon
```

This will output a 3D SVR-reconstructed volume named `SVR-output.nii.gz`.
Expand All @@ -131,5 +131,5 @@ This will output a 3D SVR-reconstructed volume named `SVR-output.nii.gz`.
##### Optional:
If you have successfully installed CUDA, you can run the GPU-accelerated version with:
```
docker run -it --gpus all -v "svrtk-docker-gpu/recon":/home/recon fetalsvrtk/svrtk:svrtk-docker-gpu-0.10 /home/scripts/docker-recon-brain-auto.bash /home/recon
```
docker run -it --gpus all -v "svrtk-docker-gpu/recon":/home/recon fetalsvrtk/svrtk:pride-svr-docker-0.2.0 /home/scripts/docker-recon-brain-auto.bash /home/recon
```
4 changes: 2 additions & 2 deletions recon/pride/SVR/StartSVR.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

:: Docker image name (default: svrtk-docker-gpu)
set hostName=%COMPUTERNAME%
set "dockerImageName=fetalsvrtk/svrtk:svrtk-docker-gpu-0.10"
set "dockerImageName=fetalsvrtk/svrtk:pride-svr-docker-0.2.0"
ECHO Using Docker Image: %dockerImageName%

:: Clear TempOutputSeries
Expand Down Expand Up @@ -46,4 +46,4 @@ if "%hostName%" EQU "PRIDESVR02-PC" (
:: Clean Recon Directory
ECHO Cleaning recon directory ...
powershell.exe C:\svrtk-docker-gpu\scripts\reconDirClean.bat
ECHO DONE
ECHO DONE
4 changes: 2 additions & 2 deletions recon/pride/SVR/StartSVR_GPU.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

:: Docker image name (default: svrtk-docker-gpu)
set hostName=%COMPUTERNAME%
set "dockerImageName=fetalsvrtk/svrtk:svrtk-docker-gpu-0.10"
set "dockerImageName=fetalsvrtk/svrtk:pride-svr-docker-0.2.0"
ECHO Using Docker Image: %dockerImageName%

:: Clear TempOutputSeries
Expand Down Expand Up @@ -46,4 +46,4 @@ if "%hostName%" EQU "PRIDESVR02-PC" (
:: Clean Recon Directory
ECHO Cleaning recon directory ...
powershell.exe C:\svrtk-docker-gpu\scripts\reconDirClean.bat
ECHO DONE
ECHO DONE
4 changes: 2 additions & 2 deletions scripts/StartSVR.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Admin
userName=$USER

# Docker image name (default: svrtk-docker-gpu)
dockerImageName=fetalsvrtk/svrtk:svrtk-docker-gpu
# Docker image name
dockerImageName=fetalsvrtk/svrtk:pride-svr-docker-0.2.0
dockerImageFolderName=svrtk-docker-gpu
echo "Using Docker Image:" $dockerImageName

Expand Down
7 changes: 5 additions & 2 deletions scripts/svr_nii2pridedcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
0x2001101a: ('FL', '3', "PC Velocity", '', 'PCVelocity'),
0x2001101d: ('IS', '1', "Reconstruction Number MR", '', 'ReconstructionNumberMR'),
0x20051035: ('CS', '1', '', '', 'unknowntag20051035'), # PIXEL --- this seems to also correspond to MRSeriesDataType?
0x20051011: ('CS', '1', 'MR Image Type', '', 'MRImageType'),
0x2005106e: ('CS', '1', 'MR Scan Sequence', '', 'MRScanSequence'),

# Philips "Stack" Tags
0x2001105f: ('SQ', '1','Stack','','Stack'),
Expand Down Expand Up @@ -463,7 +465,8 @@ def elem_initialise(uid_instance, uid_series_instance, uid_frame_of_reference, n
'NumberOfStacks': 1,
'ReconstructionNumberMR': 2,
'NumberOfDynamicScans': 1,

'MRImageType': 'M',
'MRScanSequence': 'SE',
}

return elements_to_define_meta, elements_to_transfer_meta, elements_to_define_ds, elements_to_transfer_ds, non_std_elements_to_define_ds
Expand Down Expand Up @@ -564,7 +567,7 @@ def create_seq_stack():

# override elements
setattr(ds, 'SeriesNumber', str(int(str(getattr(dcmIn, 'SeriesNumber'))) + 1) ) # +1 to SeriesNumber
# setattr(ds, 'AcquisitionNumber', str(getattr(dcmIn, 'AcquisitionNumber')))
setattr(ds, 'AcquisitionNumber', str(getattr(dcmIn, 'SeriesNumber'))[:-2])
# setattr(ds, 'InstanceCreationDate', str(today_date) )
# setattr(ds, 'InstanceCreationTime', str(today_time) )
# setattr(ds, 'SeriesDate', str(today_date) )
Expand Down

0 comments on commit ab5bff7

Please sign in to comment.