How to perform an operation after reading the image?

1 Ansicht (letzte 30 Tage)
John
John am 23 Feb. 2024
Beantwortet: Walter Roberson am 23 Feb. 2024
In imageDatastore, when defining the readFcn=readimageFcn, it can be defined as readimageFcn=@(x) int16(dicomread(x));
How to define this function to perform a normalization afrer reading the image?
This will not work:
readimageFcn=@(x) [int16(dicomread(x)); imagenorm(x)];
And a separate function is not working either:
function y=readimageFcn(x)
y=dicomread(x));
y=imagenorm(y);
end
How to make an image reading function in the following command?
datastoreone = imageDatastore(imagefiles,FileExtensions=exts,ReadFcn=readFcn);
Thank you!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 23 Feb. 2024
readimageFcn=@(x) imagenorm(int16(dicomread(x)));
There is some uncertainty here, as imagenorm() is not a defined Mathworks function, so we do not know what datatype it expects.

Weitere Antworten (0)

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by