User Tools

Site Tools


pgs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
pgs [2022/01/26 22:10]
osotolongo
— (current)
Line 1: Line 1:
-====== WMH pgs ====== 
- 
-===== HowTo ===== 
- 
-  - https://pubmed.ncbi.nlm.nih.gov/33957235/ 
-  - https://hub.docker.com/r/wmhchallenge/pgs 
-  - https://wmh.isi.uu.nl/wp-content/uploads/2019/08/pgs.pdf 
- 
-<code> 
- 
-[osotolongo@brick03 f5cehbi]$ singularity run --cleanenv -B /nas:/nas -B /old_nas/f5cehbi/output:/output -B /old_nas/f5cehbi/input:/input /nas/usr/local/opt/singularity/pgs.simg sh /WMHs_segmentation_PGS.sh sub-0020_T1w.nii.gz sub-0020_T2w.nii.gz sub-0020_WMH.nii.gz 
-Step 1  of 9: reading in images...Done! It took roughly 1 seconds 
-Step 2 of 9: registration... 
-  2a) Similarity transform... 
-  2b) Affine transform... 
-  2c) Resampling volume... 
-  Registration done! It took roughly 6 seconds 
-Step 3 of 9: rough bias field correction...Done! It took roughly 6 seconds 
-Step 4 of 9: calculating features...Done! It took roughly 28 seconds 
-Step 5 of 9: voxel classification...Done! It took roughly 17 seconds 
-Step 6 of 9: fitting the shape model...Done! It took roughly 6 seconds 
-Step 7 of 9: free deformation...Done! It took roughly 1 seconds 
-Step 8 of 9: building volume from mesh...Done! It took roughly 3 seconds 
-Step 9 of 9: warping back to original space...Done! It took roughly 0 seconds 
- 
- Output ready  
- 
- The whole process took roughly 68 seconds 
- 
- Freeing memory and deleting temporary files... 
- 
- 
-Traceback (most recent call last): 
-  File "/WMHs_segmentation_PGS.py", line 89, in <module> 
-    FLAIR_bet_data = FLAIR_data*T1_bet_mask_data 
-ValueError: operands could not be broadcast together with shapes (176,252,256) (176,256,256)  
-</code> 
- 
-<code> 
-[osotolongo@brick03 f5cehbi]$ fslinfo output/sub-0020_T1w.nii.gz 
-data_type      INT16 
-dim1           176 
-dim2           256 
-dim3           256 
-dim4           1 
-datatype       4 
-pixdim1        1.000000 
-pixdim2        0.976562 
-pixdim3        0.976562 
-pixdim4        2.200000 
-cal_max        0.0000 
-cal_min        0.0000 
-file_type      NIFTI-1+ 
-[osotolongo@brick03 f5cehbi]$ fslinfo output/sub-0020_T2w.nii.gz  
-data_type      INT16 
-dim1           176 
-dim2           252 
-dim3           256 
-dim4           1 
-datatype       4 
-pixdim1        1.000000 
-pixdim2        1.015625 
-pixdim3        1.015625 
-pixdim4        5.000000 
-cal_max        0.0000 
-cal_min        0.0000 
-file_type      NIFTI-1+ 
-</code> 
- 
-**Nota: ** Registrar T2 a T1 primero! 
- 
-<code bash> 
-[osotolongo@brick03 f5cehbi]$ antsRegistrationSyNQuick.sh -d 3 -t a -f input/pre/sub-0020_T1w.nii.gz -m input/pre/sub-0020_T2w.nii.gz -o input/pre/t2tot1_ | tee t2tot1Output.txt 
-... 
-... 
-... 
-[osotolongo@brick03 f5cehbi]$ antsApplyTransforms -d 3 -i input/pre/sub-0020_T2w.nii.gz -r input/pre/sub-0020_T1w.nii.gz -t input/pre/t2tot1_0GenericAffine.mat -o input/pre/sub-0020_T2w_resampled.nii.gz 
-[osotolongo@brick03 f5cehbi]$ ls input/pre/ 
-sub-0020_T1w.nii.gz  sub-0020_T2w_resampled.nii.gz  t2tot1_InverseWarped.nii.gz 
-sub-0020_T2w.nii.gz  t2tot1_0GenericAffine.mat      t2tot1_Warped.nii.gz 
-</code> 
- 
-{{::screenshot_t2tot1.png?600|}} 
- 
-Ahora si, 
- 
-<code> 
-[osotolongo@brick03 f5cehbi]$ singularity run --cleanenv -B /nas:/nas -B /old_nas/f5cehbi/output:/output -B /old_nas/f5cehbi/input:/input /nas/usr/local/opt/singularity/pgs.simg sh /WMHs_segmentation_PGS.sh sub-0020_T1w.nii.gz sub-0020_T2w_resampled.nii.gz sub-0020_WMH.nii.gz 
-</code> 
- 
-This is a highly massive computation, :-o Dont take it lightly! 
- 
-{{::screenshot_20220126230633.png?600|}} 
- 
-but results are amazing, 
- 
-{{::pgs_wmh.png?600|}} 
- 
-<code bash> 
-[osotolongo@brick05 f5cehbi]$ fslstats output/sub-0020_WMH.nii.gz -V  
-2353 2243.995605  
-</code> 
- 
-===== Scripting ===== 
-