Saving images with command line

Hi,

I am trying to save images from the 3dLME results with 3dClustsim clusterized.

My Afni command is

afni -com ‘SET_XHAIRS A.OFF’
-com ‘OPEN_WINDOW A.axialimage mont=3x5:4’
-com ‘OPEN_WINDOW A.sagittalimage mont=3x5:4’
-com ‘SWITCH_UNDERLAY A.avg152T1_2p5.nii’
-com ‘SWITCH_OVERLAY A.output.myLME+tlrc’
-com ‘SET_FUNC_RANGE A.0’
-com ‘SET_SUBBRICKS A 0 8 8’
-com ‘SET_DICOM_XYZ A 0 -0.75 15.5’
-com ‘SET_THRESHNEW A 0.005 *p’
-com ‘SAVE_JPEG A.axialimage Axial.jpg blowup=3’
-com ‘SAVE_JPEG A.sagittalimage Sagittal.jpg blowup=3’

I already calculated 3dClustsim and apply them to ‘output.myLME+tlrc’ by 3drefit. But with the command above, I can’t get the images clusterized.
So I just ran

afni -com ‘SET_XHAIRS A.OFF’
-com ‘OPEN_WINDOW A.axialimage mont=3x5:4’
-com ‘OPEN_WINDOW A.sagittalimage mont=3x5:4’
-com ‘SWITCH_UNDERLAY A.avg152T1_2p5.nii’
-com ‘SWITCH_OVERLAY A.output.myLME+tlrc’
-com ‘SET_FUNC_RANGE A.0’
-com ‘SET_SUBBRICKS A 0 8 8’
-com ‘SET_DICOM_XYZ A 0 -0.75 15.5’
-com ‘SET_THRESHNEW A 0.005 *p’

and manually click ‘Clusteize’ on the Afni window and change NN level and # of voxel, and click ‘set’. Then I need to put the name of images manually to
save them. I need to do these tedious jobs whenever I open Afni window to save them.

Is there any way to change NN level and # of voxel in the ‘Clusterize’ via command line, for example, I roughly guess that it might be ‘-com ‘Clusterize_NN’ 3’?

Thanks.

Jung

Hi, Jung-

There is a useful 3dClusterize example in this published paper code example (you can just search the page for it):
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/codex/main_det_2018_ChenEtal.html

For saving images automatically in AFNI, I think it would be muuuuuuch easier to use one of the wrapper programs for AFNI’s driving capability:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/auto_image/main_toc.html

There are even specific examples for 3dClusterize here with @chauffeur_afni:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/auto_image/auto_@chauffeur_afni.html
… though I do have to update the translucent-olay stuff for new syntax-- though, the helpfile for @chauffeur_afni does have hte correct usage:


-olay_alpha {Yes|No} :In addition to representing olay values as colors
                    with a threshold, one also apply opacity
                    information to 'soften' the effect of
                    thresholding; see DR: SET_FUNC_ALPHA for a
                    description of this behavior (def: "No", which is
                    just standard thresholding stuff).
-olay_boxed {Yes|No} :a partner parameter for the fancy alpha-based olay
                    viewing; put a box around supra-threshold
                    voxels/clusters. Default value is "No".  (see DR:
                    SET_FUNC_BOXED)

–pt

Thanks, Paul

3dClusterize command worked well to get the clusterized image. But using @chauffeur_afni still give me some errors for example, only showing very white anatomical image even though I already changed the range setup of it or some conflict with using tcsh.

Now I just combine 3dClusterize and ‘Afni -com’, and it worked well to save images.

Thanks again.

-Jung

Hi, Jung-

If you post your @chauffeur_afni command (and your “afni -ver” info), then we can try to troubleshoot the command usage.

–pt