Matlab Bridge Extension

The generated launcher (.bat or .sh) files are missing from https://github.com/albagcs/Final-Degree. Could you please upload them?

Also, Outliers_step1.xml and Outliers_step2.xml files are almost empty. You need to specify input and output parameters in these files.

Let me know when you uploaded/updated these files and I have another look.

Hi!

.sh files are already in the repository !

Yes, they are empty because I do not need any input parameter. I made another module which worked and it also had empty input and output. Dou you think it could be the problem?

Thank you so much!
Nice day,
Alba

Hi!

Have you seen anything weird in that .sh files? I guess the problem is not there, but I am not 100% sure.

Nice day!
Alba

The .sh files look fine.

Your algorithm need input files, but you hardcode the input paths in your instead of getting it from Slicer. It should not cause any trouble other than your module is not usable in general, just for those fixed inputs. You can leave those for now.

However, your module must return something that Slicer. What outputs your module generates that you would like to show in Slicer?

Make sure the module is called and the computation is completed. Do step-by-step debugging as described here: Documentation/Nightly/Extensions/MatlabBridge - Slicer Wiki

Hi!

Yes, I know it is not usable in general but my concrete case now, I am working on that when the basic process is working fine.

My module Outliers_step1 should generate arrays which indicate what volumes should user discard in his/her algorithm.

My module Outliers_step2 has the following outputs:

%rejected due to over deformation.
%outlierst2 are the volumes after outlier rejection
%regmask: updated mask showing corrected region with 1 and outlier voxels
%with 2, outlier: number of outlier voxels for each time frame,
%smoothmask:original mask

I have recorded a video showing the debugging for Outliers_step1, I do not understand why it is stopped at that point, no error is showed, it just stays running in loop:

I am working with another changes in Outliers_step2

Thank you so much,
Nice day!
Alba

The video was very useful. Unfortunately, you stooped the step-by-step debugging before getting to the code line that took a very long time to complete. Could you post a video that shows which line exactly takes so long? Use the “step into” debug command to follow step into the called methods.

I am glad it was useful!

Here is the other video. I added a new breakpoint and I saw the line which takes so long is the 23, but I do not why because it is just to extract size and assign parameters matrix and detJgw is properly created (it did not give an error on the command line when with the step in debugging when creating detJgw matrix ):

debug

The video is as the other one but showing the error in line 23:

Thank you so much!

Nice day,
Alba

Thanks for the additional information. Based on the video we still only know that the long computation is somewhere between line 23 and line 27. Instead of clicking on “Continue” button (that runs until you hit the next breakpoint), you should have kept clicking “Step in” (that executes the next command, stepping inside any function that is called). That would have taken you to the exact line of code that takes so long to compute. What is the size of your data set that you load into Matlab?

Hi!

It seems I have finally achieved it!. The error was I was creating my detJgw with size (110,110,80,82) but I was performing a little example by not using all the volumes in my data set (82) so I changed the size here to (110,110,80,3) and it worked. Now I am trying to execute the module with all my volumes.

I am dealing with outliers_step 2 module, I am investigating more about why it still fails.

Thank you so much!
Nice day,
Alba

1 Like