Need help saving an image in imageJ through MIJI/MATLAB Interface

I feel like this is such a simple task but I cannot for the life of me figure out how to just save the stitched image Fiji produces for me. I can tell the program to run through the plugins and do the stitching but after that I just want to save and close the image and move on to the next loop iteration and not bog down the memory. I have tried using the MIJ.run command and doing something like:
MIJ.run('saveAs', 'Tiff..., path=[F:\\4_19_16\\LB598_LL_2_3_4_5\\XY01\\x.tif]');
But the MATLAB doesn't like what I am telling it to do and says that "SaveAs is an unrecognized command". Does anyone know how to do this? I appreciate any help. It does it for both save and save as.

Antworten (2)

Sergey
Sergey am 12 Mai 2016

2 Stimmen

Use Save instead
MIJ.run('Save', 'Tiff..., path=[F:\\4_19_16\\LB598_LL_2_3_4_5\\XY01\\x.tif]');

4 Kommentare

This doesn't give an error. But it doesn't seem to actually save it. I can see that ImageJ is processing the command, but no file appears in the given directory. Nor does it overwrites the original image. Does it work for you?
For me the command worked. Thx a lot!
However I needed to refresh the destination folder before it was shown.
it does not work on my computer
PaulB
PaulB am 23 Aug. 2021
Bearbeitet: PaulB am 23 Aug. 2021
Hello,
The 'Save' command given by Sergey did work, but it does not allow to change the name of the file. This command overwrite on the image file, which i don't want.
I used this command :
MIJ.run('Save','Tiff..., newName');
where newName is a contatenated String variable composed of the initial image name and '_crop'.
EDIT : I did found a workaround using the Duplicate command :
MIJ.run('Duplicate...', strcat('title=[', newName, ']')) ;
MIJ.run('Save','Tiff...') ;
An ImageJ 'Save' dialog box then appears, you just have to hit Enter.

Melden Sie sich an, um zu kommentieren.

sorly
sorly am 23 Sep. 2021

1 Stimme

Hi,
It seems this works for me:
MIJ.run('Tiff...','path=[newName]');

Kategorien

Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 9 Mai 2016

Beantwortet:

am 23 Sep. 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by