Undefined function 'channelWisePreProcess' for input arguments of type 'char'.

1 view (last 30 days)
I am create the imagedatastore. Input data was using cropping and normalization of 3d nii file. But folllowing error as Error using matlab.io.datastore.ImageDatastore/read (line 77)
Error using ReadFcn @(x)channelWisePreProcess(x) function handle for file
Undefined function 'channelWisePreProcess' for input arguments of type 'char'.
Error in @(x)channelWisePreProcess(x)

Answers (1)

Abhinav Aravindan
Abhinav Aravindan on 31 Dec 2024
I assume you are trying to use a modified form of the “channelWisePreProcess” function defined in the “preprocessBraTSDataset” helper function provided in the example “3-D Brain Tumor Segmentation Using Deep Learning” in MATLAB R2022a as the “ReadFcn” property for creating an “Image Datastore”.
The function “channelWisePreProcess” seems to accept 4D matrices as input whereas the function handle to “ReadFcn” must take an image file name as input and output the corresponding image data. This mismatch in expected functionality might be the possible cause of the error you are encountering. Please refer to the documentation below for more detail on the “ReadFcn” property.

Community Treasure Hunt

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

Start Hunting!