Macro recording of Sholl Analysis plugin failing

Hi Tiago

I’ve prepared all my images using the instructions for batch processing for the 2017 software, from this site Sholl Analysis - ImageJ.
I cannot now get it to work in my updated FIJI with neither the SNT package or the “legacy” software.

Do you have any suggestions please? Do I have to go back to the start and trace all my cells rather than just threshold and make binary?

Thanks
Chloe

Welcome to the forum @chloemhall,

Absolutely not. I am assuming you are referring to this chapter of the documentation: https://imagej.net/Sholl_Analysis.html#Batch_Processing, correct?
You will have to provide more details on what exactly is not working. Which commands/macros/scripts are you using? What is failing? Which errors/exceptions are occurring?

Hello and thank you.
Yes that is the exact part of the documentation to which I was referring.
Okay I am new here and so sorry if this is bad forum etiquette, but I’ll try and be as detailed as possible in case you can spot any obvious mistakes I am making!

This is my macro, that I type into process–> batch → macros

run("Set Scale...", "distance=2.1658 known=1 pixel=1.000 unit=micron global");*
setOption("BlackBackground", false);*
run("Convert to Mask");*
run("Sholl Analysis (From Image)...", "startradius=5.0 stepsize=5.0 endradius=150.0 hemishellchoice=[None. Use full shells] previewshells=false nspans=3.0 nspansintchoice=Mean primarybrancheschoice=[Infer from starting radius] primarybranches=0.0 polynomialchoice=['Best fitting' degree] polynomialdegree=0.0 normalizationmethoddescription=Semi-Log normalizerdescription=Default plotoutputdescription=[None. Show no plots] tableoutputdescription=[Detailed table] annotationsdescription=[ROIs (points and 2D shells)] lutchoice=mpl-viridis.lut luttable=net.imglib2.display.ColorTable8@47fe0007 save=true savedir=[**my desired folder**] analysisaction=[Analyze image]");

If I process, FIJI just gets stuck on an empty Sholl Analysis 3.2.0 dialog box. Weird.

So I went back to try and debug using just one image at a time. Problems that I encounter with this are:

  • It won’t accept end radius as NaN like your documentation says you can do, for images of different sizes. I can overcome this by making an overly large end radius.
  • It does not recognise the point I previously (using step 5 of the documentation) as an ROI
  • If I manually make a new ROI and press analyze image, I get error message: "IO FAILURE: Some file(s) (1/2) could not be saved. Please ensure “Destination” directory is valid. " - It is successfully saving the Sholl Profile linear plot, and the .csv Sholl profiles, it is not saving the ROIs (points and 2D shells)

Sorry, this feels like a lot and I understand if you can’t help me, the main worry is that I have to manually trace all my cells again so it’s good you said I shouldn’t need to do that!

Thanks so much,
Chloe

@chloemhall ,

The problem stems from the fact that the IJ2 version of the plugin is not fully macro recordable. That prompt is highly interactive and that makes recording harder to execute. While ago, we had ‘hidden’ the old IJ1 plugin from ImageJ’s menu hierarchy because the new IJ2 re-write fixed several issues, and we did not want to add to the existing clutter of not-that-useful commands to the crowded plugins menu. But in doing so, we also hid the IJ1 plugin from the Macro Recorder. Please do the following:

  1. Run the updater to update the Neuroanatomy plugins to version 3.2.2
  2. You will find a “Legacy: Sholl Analysis (From Image)…” command . This is the IJ1 plugin, and so all of the details at Sholl Analysis - ImageJ remain dully functional.

On a related note: Macro recording is quite useful, and it is unfortunate that the new prompt is not fully recordable. We will try to look into it. But we find the scripting capabilities of all the neuroanatomy plugins to be really good, and far more manageable than recorded macros. We have made a couple of minor tweaks that hopefully will make scripting more accessible:

  1. The Neuroanatomy Shortcut Window now lists all of Sholl-related scripts (typically registered only in Script Editor’s Templates → Neuroanatomy → menu). This should make them easier to find and play with
  2. The recorder should provide you some hints when recording legacy commands (and some warnings when recording the newer IJ2 prompt)
  3. We’ve edited the Templates → Neuroanatomy → Analysis → Sholl_Extract_Profile_From_Image_Demo.py_ script so that it can be used to batch process images, using the ‘Batch’ feature of the Script editor, which allows you to apply the script to a selection of files.

I did not have time to look into the IO Failures, but the ROIs are not saved in separate files. They are stored as image overlay, and saved with the image.

Hi Tiago,

Thank you so much for your detailed response and advice. I ended up using the newer SNT plugin, the youtube how to videos were really good too so thank you for those!

Thanks again, very grateful.
Chloe