How to perform an operation after reading the image?

조회 수: 1 (최근 30일)
John 2024년 2월 23일
답변: Walter Roberson 2024년 2월 23일
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)
How to make an image reading function in the following command?
datastoreone = imageDatastore(imagefiles,FileExtensions=exts,ReadFcn=readFcn);
Thank you!

채택된 답변

Walter Roberson
Walter Roberson 2024년 2월 23일
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.

추가 답변 (0개)




Community Treasure Hunt

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

Start Hunting!

Translated by