BCBToolkit Questions

Hello,

Chris and Michel will be happy to answer all your questions about BCBtoolkit here!
shapeimage_2

Hello Chris and Michel!

Thank you for putting this discussion thread together. I am hoping you can help me out with a file reading error I keep getting when trying to run the disconnectome analysis.

Details:
I downloaded the mac version of BCBtoolkit to a new 2018 macbook pro running Catalina 10.15.5. As directed by the BCB website, I ran sudeo spctl --master-disable in the terminal. I was then able to successfully run the disconnectome maps function on the .nii file already available in the BCBToolKitOSX/Lesions directory, but received error message when trying to run the same function on my own .nii lesion masks.

The lesion mask that produced the error was created using the SPM Clinical toolbox. Specifically, 3d mprage T1 images and corresponding tumor binary maps (previously segmented and binarized in 3dslicer) were normalized to an SPM template in MNI152 space using an enantiomorphic normalization procedure. SPM then outputa a “binarized, warped, smoothed lesion map (‘bwsLesionT2.nii’).” When I try to run the disconnectome function on the SPM output .nii, I get the following error:

****Script Error ****
Cannot open volume /path to lesion .nii …for reading!

I can view the lesion map in MRIcron and confirmed that the lesion is labeled as 1 and non-lesion is 0. SPM tells me that the maps are in MNI space, but I unfortunately do not know how to check this for sure.

Any help you can provided would be great! Thanks in advance for your time!

Travis

Hi Travis, thanks for your message. Looks like you might have a space somewhere in the path to your files.
Would you have the kindness to upload your log file so that we can look into this closely?
Thanks

Mich

Oh and SPM MNI is not the same MNI as MNI152, this is also a good reason for the software to not work.
You have 2 options either you can reslice your lesions to our MNI152 (you’ll find it in the BCBtoolkit folder)
Alternatively you can register again your native T1s to the MNI152 of BCBtoolkit using the tool “normalise” implemented in BCBtoolkit. Hope this helps.
Mich

Mich, thank you for your reply!

You’ve given me a couple avenues to explore, which I appreciate. I will double check spaces in path and I will try the reslice option. To be honest, I didn’t realize there were so many different MNI152 templates (linear, nonlinear, and options for different cohorts; https://www.lead-dbs.org/about-the-mni-spaces/). I believe the difference between SPM’s MNI152 and BCBtoolkit’s MNI152 template is the most likely cause of my error. For my own curiosity and documentation, can you confirm for me which MNI152 template the BCBtoolkit uses?

If reslicing doesn’t work, I will also be more than happy to upload the log file (though this will be a litter later today as I do not have my mackbook with me at the moment).

Thanks again for help. It is much appreciated.

Travis

Update: I used SPM to coregister my lesion maps to the MNI 152 template in the bcbtoolkit directory and everything worked like a charm!

Thanks again Mich for your help!

My pleasure. Happy to hear that it is working. Always glad to receive feedback.

Regarding the templates, I’ve been in the same situation as yours, here is my summary of the MNI templates story:

While the coordinates system is supposed two be roughly the same between one MNI and another, some small differences typically crash analyses. We are using the MNI from FSL, which is an older version of the MNI from the Montreal Neurological Institute (http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009). While the ICBM template looks better, we prefer to use its older version because not everybody has a top-notch MRI in the stroke community, and an older template might be more representative of your T1 images.
SPM uses another MNI template cropped and smoothed for various reasons. The cropping is an issue as the images register in SPM MNI will not match the size of the images of tractotron or disconnectome templates. Finally, the Colin template from MRIcron is a single brain registered to the MNI (the brain of Colin Holmes!) but is missing one slice compared to the MNI we use (which will crash the analysis as well).
We could have modified the code so that any MNI works, but results might have subsequently been biased in some cases because of errors in the alignment.
I hope this helps!
Kind regards

michel

Hi!

I am trying to use the BCBtoolkit to create disconnectome maps, but the program is producing an error that says it cannot read my roi files. I am using a lesion in MNI 2x2x2mm space. How can I resolve this error?

Thanks,
William

Hi William

Thanks for your email.

BCBtoolkit is optimised for 1mm MNI

So you can either reslice your lesions to 1x1x1mm (the easiest, I can even do it for you if you don’t know how to) or I can provide you with the disconnectome 2x2x2 mm.

I usually use fsl and bash for this:
flirt -interp nearestneighbour -in M2006_lesion.nii -ref MNI152_T1_1mm_brain.nii.gz -out wM2006_lesion.nii -usesqform -applyxfm

If you use something else be especially careful with the interpolation rule you use. E.g. trilinear will give you continuous values. You want to use nearestneighbour in order to keep your lesions images binary.
Hope this makes sense.

We can zoom this out if you run in any trouble.

Hello,

I have a few questions related to the AnaCOM2 software in BCBtoolkit and the clever way you utilized it in your paper “Advanced lesion symptom mapping analyses and implementation as BCBtoolkit”.

In your paper, you use disconnectome maps instead of lesion masks as input when running AnaCOM2 to identify clusters associated with the performance in a category fluency test. I wish to use a similar approach for our sample of 328 MRI-scanned MS patients in relation to various clinical and cognitive measures.

  1. Is a comparison with a control group a requirement for this analysis even if I only wish to run comparisons between disconnected vs. spared?
  2. If inclusion of a normative control value is required (we do not have scores from healthy controls), how is this normative value included in a disconnected vs. spared comparison?
  3. Finally, a technical support question: When attempting to run AnaCOM2 it immediately stops and only produces an empty csv-file called copypatients.csv without showing any error messages.
  • Lesion directory contains disconnectome maps in nii.gz-format (I have also tried running with lesions in nii-format).
  • Result directory is specified as an empty location.
  • Patient names and scores are included in a csv-file.
  • I have tried different formats for the patient name including full path and with/without file extension.
  • I run the software on macOS Catalina Version 10.15.3
  • I have tried the suggested fix for Catalina users (http://toolkit.bcblab.com/): sudo spctl –master-disable
  • I have successfully run Disconnectome Maps, FSL and R on the same computer earlier.

Best,
Henning

Hi Henning,

Thanks for your interest in the BCBtoolkit.

Regarding Anacom2, this has been designed for small samples (less than 50 participants) otherwise it is going to take an eternity for you to get your results.

For big samples like yours, I would recommend you to use fsl randomise instead as we did for Pacella et al. Elife (2019) https://elifesciences.org/articles/46075

Best of luck with your analyses. Kind regards. mich

Just wanted to post I got a script error and Michel kindly pointed out my files were MNI 2mm and not 1mm — easy fix :slight_smile: thanks Michel!

1 Like

Hello BCBToolkit Stars,

I have an issue running AnaCOM2 on disconnectome data that I have created with the BCBToolkit.

The error provided by AnaCOM2 states that the behavioural data contains scores that are <= 0. I have checked the file and there are no scores in the file that are <=0.

To solve this problem I have tried;

  • Using commas and colons to separate the score and filename columns and receive the error regardless.
  • Specifying the filename with and without extensions (errors either way).
  • To check the filenames are correct, I have also written out the filenames of the disconnectome maps in the folder [using dir(’*.nii.gz’)] to csv to verify that the image filenames match the filenames in the behavioural data.
  • I’ve looked at the file in TextEdit and see no hidden characters or empty rows
  • I have selected a smaller subset of the scans (just frontal patients) and still receive the error (n=88).

I’m running version 4.1.0 on a macbook pro (mid 2017) with catalina 10.15.6. I have run the suggested command line functions to give permission to bcbtoolbox to run.

I’ve attached a copy of the csv (as a txt) as an example in case I have missed something obvious.
PLSM_behaviouraldataf1.txt (694 Bytes)

Thank you in advance,
Bronson

Hi Bronson, Apologies for the delay, I am in the middle of the grant season for my students.
As far as I remember my colleague ran through the same issue here.
A few reasons that might help:

  • The name of the file must be the same as the name of the lesion. I see that you used F01, F02, F03… please use the same name as you lesion file (maybe F01.nii.gz)
  • No headers in the CSV file should be used.
  • Another potential reason is that some MACOSX distributions of Excel create weird CSV with hidden characters (that even TextEdit can’t see)
    Try with the attached file to see whether it works now. (check that I used the correct extension fo your lesions though! and change the .txt for .csvscores.txt (1.2 KB) )
    Kind regards

mich

1 Like

MANAGED BY INCF