Using ImageJ as a plugin for mass image analysis
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am currently trying to use ImageJ as a plug-in where I can open a file and have the script apply certain settings to it (Image>Adjust>Color Threshold> Color Threshold: B&W, Brightness = 75). I've been able to open the image, but I'm having trouble applying the settings I want. The "Apply" command isn't working and I am running out of ideas. I've attached the code below. Can anyone help?
javaaddpath('C:\Program Files\MATLAB\R2023b\java\mij.jar');
javaaddpath('C:\Program Files\MATLAB\R2023b\java\ij.jar');
MIJ.start;
% Browse for the JPEG or TIFF file
[filename, filepath] = uigetfile('*.*');
imagePath = fullfile(filepath, filename);
% Open the image using MIJ
MIJ.run('Open...', ['path=[' imagePath ']']);
% Open the Color Threshold dialog
MIJ.run('Color Threshold...');
% Set color space to B&W
MIJ.run('Set... ', ['thresholded color=B&W']);
% Close the Color Threshold dialog (applies the changes)
MIJ.run('Close');
0 Kommentare
Antworten (1)
Rahul
am 8 Apr. 2025
I understand that you wish to apply color threshold to your image and are not able to "Apply" it while running the MIJ.run('Close') command. The following command can be used to apply the required threshold:
MIJ.run('Convert to Mask');
% After this commmand to close tha pplication run
MIJ.run('Close All');
The following MATLAB Answer and File Exchange submission can be referred to know more about MIJ commands in MATLAB:
https://www.mathworks.com/matlabcentral/fileexchange/47545-mij-running-imagej-and-fiji-within-matlab
Thanks.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!