spunt / bspmview

MATLAB program for viewing 3D fMRI statistical images
http://www.bobspunt.com/software/bspmview
53 stars 26 forks source link

Save Current Cluster export issue #10

Open bmelo opened 8 years ago

bmelo commented 8 years ago

Hi,

When I try to export a specific cluster ,clicking in Save Current Cluster (Binary Mask) and also Save Current Cluster (Intensity), the NIfTI file generated has another cluster that is not related with the cluster of interest.

For example, in one case I was trying to generate a ROI with a cluster in Superior Frontal Gyrus (peak at 3,50,29) I got a NIfTI file with this cluster and another cluster not related and not near with peak at -21, -40, 35.

clusters export issue

If necessary, I can provide the data that I'm having this trouble.

This issue is not occurring always!

Even so, congrats for the software. It's helping me a lot even with this export issue. Thanks.

spunt commented 8 years ago

Hi - Thanks for reporting this issue. Glad the software has been useful to you. Can you provide one of the image overlays you're seeing this issue with? I can't reproduce the issue in my own data so I'd like to confirm that I also see it with your data, and then assuming I do see it should be easy to nail down what's causing this.

Cheers, Bob

bmelo commented 8 years ago

Thanks Spunt. I'm sending a zip file with the image that I used to export and the cluster exported with this issue.

Example.zip

spunt commented 8 years ago

Hi again - Thanks for sharing this. It allowed me to find and correct the issue, which was in subfunction getcurrentblob. In that function, I was accidentally using the cluster extent (instead of cluster index) to find it in the array containing the data for the entire volume. Since that other cluster had the same extent as the medial PFC cluster you were grabbing, it was erroneously being included, too. I just pushed an update to the repository that corrects this issue. Give it a shot and let me know if you are still having problems.

Cheers, Bob

marsomarso commented 6 years ago

Hi there,

Thanks so much for your tool!

I'm having a similar issue using save currentl cluster as binary mask (my version is from April 2017 so it will have included this fix). However, the extent of the two blobs is not the same, I'm getting random small clusters which are also saved in my binary mask. I attach a zip with the t-stat and the mask image for reference.

Thanks, Marso bspmview.zip

marsomarso commented 6 years ago

Also, in some instances I am getting a mask of the whole brain when I select to save current cluster. Has this come up before?

spunt commented 6 years ago

Hi there - Sorry for the delayed response. So, after some fiddling I was able to reproduce this issue and produce the same output binary image as the one you sent over. The problem only occurs when both positive and negative values are being displayed (+/- option in the upper left Direction toggle). That is, when I display only voxels showing positive contrast (+ in Direction toggle), the Save Current Cluster (Binary Mask) option works as expected.

Can you confirm that this is true for you? If it is, then you should be able to safely save individual clusters to binary image files by making sure you are not viewing both positive and negative contrast when saving.

In any case, I will look into this bug with positive/negative views and saving clusters as soon as I can find the time.

marsomarso commented 6 years ago

Thanks for the heads up. That worked for those images but when I tried using just the + values for another image I am still getting other clusters being saved in the mask. My quickfix is to open the binary image and then resave the cluster from this using the save current cluster.

spunt commented 6 years ago

Darn, well thanks for looking into it and tolerating the quickfix for now. I should have time to look into this next week and will update this issue (and the repo) with any changes. I will do my best to not make things even worse :)