APQC index.html InstaCorr (IC) button opens AFNI but doesn't load dataset

AFNI version info (afni -ver): Precompiled binary macos_13_ARM_clang: Feb 26 2024 (Version AFNI_24.0.08 'Caracalla')

Hi, thank you for the very helpful APQC output! I'm having a minor issue that I can't figure out. I use open_apqc.py to open the index.html file and everything seems good (Rate is green, NV works, etc.).

AFNI opens when I click the IC button, but the underlay and overlay are set to MNI152_2009_template_SSW.nii.gz rather than the dataset that I was attempting to look at IC for. The dialog popup has what looks like the correct info (e.g., the InstaCorr calc and initial ulay datasets are "pb03.sub-05.r01.volreg+tlrc.HEAD").

I can manually change the ulay and set up InstaCorr, but for checking many subjects it would be helpful if the IC opened automatically. Has anyone seen this before or have any suggestions?

It happens when I use open_apqc.py for many results folders from the main data directory, and for individual results folders from within those folders. It also happens for all IC buttons I press within an index.html file.


Hi, Brad-

Hm, that is an odd combination of behaviors for the overlay. Just to check, does that pb03.sub-05.r01.volreg+tlrc.* dset still exist in the main AP results directory?

You shouldn't have to update the InstaCorr stuff; that is one of the major benefits of having the buttons activate the pre-made scripts.

It is possible that there was a bug in that version of the APQC generation, though I can't find a comment about that in my git commits.

Depending on the details here, it might make sense to update your AFNI and regenerate the APQC HTMLs. This does not require re-running afni_proc.py (so, a shorter process). And a benefit would be that some new functionality has been added since Feb, 2024: in particular, when you open multiple APQC HTMLs with open_apqc.py, you can double click any gold title to "sync" all tabs/pages that were opened together, and hence check one QC item across many subjects very efficiently. In my view, that alone would be worth updating---let me know if that sounds appealing.

Also, you may have seen this recent draft, but it describes a lot of functionality (some additional things, like the TSNR tables, are new since Feb, 2024, too):


Thanks Paul, I figured it out! Updating AFNI and regenerating the APQC HTMLs didn't change the behavior, but it did prompt me to consider that the results directories are stored the cloud (google drive, which has a mess of a file path that includes an @ and a space). When I transfer a results directory to my hard drive and open the APQC index.html file, IC automatically opens in AFNI correctly.

Happy to have updated afni with the newest APQC functionality too.

Ah, OK. Indeed, spaces in filenames is a pain; the open_apqc.py functionality makes use of full paths.

That is good for us to be aware of, and thanks for troubleshooting it. It still surprises me when large computer companies put spaces in filenames. Blargh.

And I do think the newer functionality is worth the update---now you can easily check multiple properties across one subject (old functionality) as well as a single property across subjects (new functionality). That is pretty useful.

Happy QCing from here!


I tried it with a few subjects and the gold title syncing does seem very helpful. Am I correct that to get that functionality, I only need to regenerate the HTML, as in:

apqc_make_html.py -qc_dir QC_$subj >> output.post.$scriptname.$subj

I tried that and it did get gold title syncing to work, but I just want to make sure I'm not missing something.

I wonder what you all do to store the output of post-AP processing steps? Often they're more substantial than this (e.g., sometimes I get apqc errors when running afni proc and have to re-run apqc_make_tcsh.py; still minor but I like to keep a log). You can see my strategy above, saving to an output.post file in the subject's directory. I considered appending directly to the output.proc file but that felt like a violation. Do you have a best practice?

Thanks again,

Hi, Brad-

Ah, I guess that is true, you would only need to do that 2nd step of the APQC HTML generation for the jumping functionality. To get something like the TSNR table (currently just in for MNI space output), you would have to re-run this prior:

apqc_make_tcsh.py -subj_dir . -uvar_json out.ss_review_uvars.json

To log commands, we use tee to capture the terminal text and save it in a log file, such as:

# tcsh syntax
apqc_make_html.py -qc_dir QC_$subj  |& tee log.txt

# bash syntax
apqc_make_html.py -qc_dir QC_$subj  2>&1 | tee log.txt

The benefit of tee is that it should capture both standard error and standard output (not just standard output, which redirecting with >> will do), and you can see the text in the terminal while it runs, as well.

Note that apqc_make_tcsh.py also has a -do_log option, to save a very granular set of outputs for each shell/subprocess command run to create APQC HTML output files (like the snapshot images and text tables); that can produce a very large text file of stanard output, standard error, and terminal text. That is often overkill except when debugging.