Matlab bridge

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Matlab bridge

Marina Cebollero
Dear team,

I'm trying to create a Matlab module for Slicer with Matlab Bridge.
I get an error when trying to write the info from a matrix M into the img.pixelData param.

function outputParams=TFG(inputParams)

% Parameters:

%  inputParams.threshold: threshold value

%  inputParams.inputvolume: input image filename

%  inputParams.outputvolume: output image filename, result of the processing

%  outputParams.distancia: image minimum value


img = cli_imageread(inputParams.inputvolume);

M = img.pixelData;

S = size(M);


img.pixelData = M;

cli_imagewrite(inputParams.outputvolume, img);


I get the error: 


expr: syntax error

Failed to execute Matlab function: TFG, received the following error message:

ERROR: Command execution failed. Field assignment to a non-structure array object.


Error in TFG (line 102)

img.pixelData(1) = M;


Error in cli_commandserver (line 91)

response=evalc(cmd);


Error in run (line 86)

evalin('caller', [script ';']);




​Do you know how can I fix it?​

​Thank you very much,

King regards,​


--
Marina Cebollero

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Matlab bridge

lasso2

We’ve moved all discussions to https://discourse.slicer.org. Could you please post your question there?

 

Thank you,

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Marina Cebollero
Sent: Monday, May 29, 2017 6:15 PM
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] Matlab bridge

 

Dear team,

 

I'm trying to create a Matlab module for Slicer with Matlab Bridge.

I get an error when trying to write the info from a matrix M into the img.pixelData param.

function outputParams=TFG(inputParams)

% Parameters:

%  inputParams.threshold: threshold value

%  inputParams.inputvolume: input image filename

%  inputParams.outputvolume: output image filename, result of the processing

%  outputParams.distancia: image minimum value

 

img = cli_imageread(inputParams.inputvolume);

M = img.pixelData;

S = size(M);

 

img.pixelData = M;

cli_imagewrite(inputParams.outputvolume, img);

 

I get the error: 

 

expr: syntax error

Failed to execute Matlab function: TFG, received the following error message:

ERROR: Command execution failed. Field assignment to a non-structure array object.

 

Error in TFG (line 102)

img.pixelData(1) = M;

 

Error in cli_commandserver (line 91)

response=evalc(cmd);

 

Error in run (line 86)

evalin('caller', [script ';']);

 

 

 

Do you know how can I fix it?

 

Thank you very much,

 

King regards,

 

 

--

Marina Cebollero


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ