VervaekeLab / NANSEN

Hennestad et al. 2022
MIT License
22 stars 7 forks source link

Error in matlab when running autosegmentation #16

Open ana-ich opened 9 months ago

ana-ich commented 9 months ago

Hi, I'm trying to run autosegmentation on a recording and I get this error when it tries to run the algorithm. // Error using - Array dimensions must match for binary array op.

Error in flufinder.preprocess.removeDynamicBackground (line 29) imageArray = imageArray - min(imageArray(:));

Error in flufinder.module.preprocessImages (line 43) imArray = flufinder.preprocess.removeDynamicBackground(imArray);

Error in flufinder.runAutoSegmentation (line 30) imArray = flufinder.module.preprocessImages(imArray, params);

Error in imviewer.plugin.RoiManager/runAutoSegmentation (line 537) foundRois = flufinder.runAutoSegmentation(Y, opts);

Error in roimanager.RoimanagerDashboard/onAutosegmentationOptionsChanged (line 621) obj.runAutoSegmentation()

Error in roimanager.RoimanagerDashboard>@(varargin)obj.onAutosegmentationOptionsChanged(varargin{:}) (line 381) callbacks{i} = @obj.onAutosegmentationOptionsChanged;

Error in structeditor.App/editCallback_propertyValueChange (line 2283) obj.Callback{obj.currentPanel}(name, newVal)

Error in structeditor.App>@(varargin)obj.editCallback_propertyValueChange(varargin{:}) (line 1785) inputbox.Callback = @obj.editCallback_propertyValueChange;

Related documentation

Error while evaluating UIControl Callback. //

I tried different algorithms and selected channels (I have two). I also tried to draw ROI by myself; everything slows down, and the autodetect tool is not great. :( nansen

Thanks!

ehennestad commented 9 months ago

Hi and thanks for reporting these issues!

Are you working on a branch of this repository or have you installed NANSEN from FileExchange/MATLAB's Addon Manager?

I have pushed a fix for this error on the main branch:

Error using -
Array dimensions must match for binary array op.

Error in flufinder.preprocess.removeDynamicBackground (line 29)
imageArray = imageArray - min(imageArray(:));

You mention that everything slows down, is this when you use the auto detection tool? I see from the screenshot that you have loaded some images (indicated by the green bar on the frame scrollbar). The auto detection tool will be very slow if images are not loaded, but since you have loaded some images I am not sure what causes this.

It might be that the auto detection tool does not work great because the size (radius) of the rois are different from the default settings. I apologise, right now this is actually not possible to adjust, but I will look into this as soon as possible.

You mentioned you tried different algorithms. Did you do this through the roimanager, or from the main nansen app?

ehennestad commented 9 months ago

It might be that the auto detection tool does not work great because the size (radius) of the rois are different from the default settings. I apologise, right now this is actually not possible to adjust, but I will look into this as soon as possible.

This is actually not correct:

The radius for auto detection is adjustable in the following way: When the autodetection tool is active, press alt and scroll with the mouse. The crosshairs will expand and contract.

I will still make a more explicit way for adjusting this.