help > Second overlay not showing up
Showing 1-3 of 3 posts
Display:
Results per page:
Feb 8, 2023  02:02 PM | m rad
Second overlay not showing up
Hi, 

I've prepared the attached script to save an image of the two overlays (one showing positive and the other showing the negative values). For some reason, once I apply the gl.removesmallclusters for the second overlay, only the results for the first overlay are displayed, even though the second overlay also has sig. clusters after the cluster correction is applied (I verified this when I run the same script but switch the overlay display parameters for the first and second overlay OR if I just modify the script to only have one overlay OR if I just use the GUI and not the script). 

Any idea how to resolve this issue?

Thanks,
Milena
Attachment: TEST.py
Feb 8, 2023  02:02 PM | m rad
RE: Second overlay not showing up
I'm also attaching a sample nifti file that I used. 

Thanks,
Milena
Attachment: TEST_066.nii.gz
Feb 13, 2023  02:02 PM | Chris Rorden
RE: Second overlay not showing up
1. There is something wrong with the compression of your sample file `TEST_066.nii.gz`. Most tools do not like it and those that do strip the file extension. Not sure what went wrong, perhaps it is missing the CRC footer:

fslhd TEST_066.nii.gz
Error: file does not appear to be a valid NIFTI or ANALYZE image

2. I have no problem applying small cluster with MRIcroGL 1.2.20220720 - see the attached image that shows the influence of applying the remove cluster feature. I do think your cluster threshold of 15mm3 is unrealistic for smooth data where each voxel is 2x2x2mm = 8mm3. For details, see here. 
  https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage#Cluster_Thresholds
given that your images do not match the native background resolution, you may want to consider using this SPM script instead:
 https://github.com/rordenlab/spmScripts/blob/bb984930e68952f359a7968536503b7e8dcbc419/nii_threshreslicecluster.m


```
#open background image
gl.loadimage('spm152')
gl.orthoviewmm(37,-51,37)
#open overlay: show positive regions
gl.overlayload('/Users/chrisrorden/a/TEST_066.nii')
gl.minmax(1, 3, 4)
# removesmallclusters(layer, thresh, mm, neighbors) -> only keep clusters where intensity exceeds thresh and size exceed mm. Clusters based on neighbors that share faces (1), faces+edges (2) or faces+edges+corners (3)
gl.removesmallclusters(1,3,120,2)
gl.overlayload('/Users/chrisrorden/a/TEST_066.nii')
gl.minmax(2, -3, -4)
gl.colorname (2,"3blue")
gl.removesmallclusters(2,-3,120,2)
```

3. A disadvantage of running graphical applications in Windows is that they are not associated with a command line. If you launch MRIcroGL from the command line with Linux or MacOS you will get thresholding details. For the example, with my script above:

```
RemoveSmallClusters(thresh=3.0000, mm=120)
resliced voxels 207x256x215
mm2vox=299
voxelsExceedingThresh=38587 (15476.2260mm3)
voxelsInLargeClusters=30080 (12064.2931mm3)
Load time 0
Reorient time 118
float range -12.6575717926025..6.40450620651245
float window -2.86352729797363...2.39658260345459
Init time 43
RemoveSmallClusters(thresh=-3.0000, mm=120)
resliced voxels 207x256x215
mm2vox=299
voxelsExceedingThresh=93007 (37302.6500mm3)
voxelsInLargeClusters=82839 (33224.5339mm3)
```
Attachment: comp.png