raacampbell / matlab_elastix

MATLAB Elastix wrapper
http://www.mathworks.com/matlabcentral/fileexchange/52982-matlab-elastix
GNU Lesser General Public License v3.0
26 stars 12 forks source link

Errors while running MelastiX examples #28

Open Nisha53 opened 3 years ago

Nisha53 commented 3 years ago

Error` using fwrite Invalid file identifier. Use fopen to generate a valid file identifier. Error in mhd_write (line 61) cnt=fwrite(fid,im,class(im)); Error in elastix (line 217) mhd_write(movingImage,movingFname); Error in example_2D_affine_alpha>runExampleLena (line 52) reg=elastix(lenaTrans,lena,[],'elastix_default.yml','paramstruct',p); Error in example_2D_affine_alpha (line 40) runExampleLena(lenaTrans,lena,p,ind)

the following errors were coming while performing the examples given in the matlab elastix . please help me to resolve these issues.

raacampbell commented 3 years ago

Is that the full error message? What's the MATLAB version and OS? FWIW, I just tested the tools on Win 10 running MATLAB R2021a and they work. My hunch is that a permissions problem is stopping you from writing to a temporary directory. But that's just a wild guess.

Nisha53 commented 3 years ago

Yes this was the full error coming . I am using Matlab R2020a and OS is windows 10.

raacampbell commented 3 years ago

I suggest use the debugger or otherwise interrogate where it's trying to generate these files and why it's failing. I can't replicate your issue so I can't advise much more than that at the moment. Let me know what you find.

On Wed, 5 May 2021, 11:59 Nisha53, @.***> wrote:

Yes this was the full error coming . I am using Matlab R2020a and OS is windows 10.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/raacampbell/matlab_elastix/issues/28#issuecomment-832598546, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJNEYYTZCHUK3JHNIDKYKLTMEQIZANCNFSM44DEGZEA .

raacampbell commented 3 years ago

I'm sorry, but I can't add anything: I can't replicate your error. You should use conventional debugging approaches to figure out why there is a write error to that location and what is causing it. The error message is telling that the function mhd_write write is failing to properly open a file for writing. So see what is the path it's trying to write to. Do you have permissions to write there? Does the path exist?