where inp is my input image
inp=b DatasetPath=fullfile('C:\Users\Desktop\to'); imds=imageDatastore(DatasetPath, 'IncludeSubfolders', true,... 'LabelSource','foldernames','fileextension',{'.dcm'}); labelDir = fullfile(DatasetPath,'testImages'); I = readimage(imds,1); I = histeq(I); imshow(I) classes = [ "MALIGNANT","BENIGN" ]; labelIDs=[255 0] inputlayer = imageInputLayer([512 512 1],'Name','inp') numFilters = 64; numLayers = 16; layers = [ ... imageInputLayer([512 512 1]) convolution2dLayer(5,20) batchNormalizationLayer reluLayer maxPooling2dLayer(2,'Stride',2) convolution2dLayer(5,20) batchNormalizationLayer reluLayer maxPooling2dLayer(2,'Stride',2) transposedConv2dLayer(4,numFilters,'Stride',2,'Cropping',1); convolution2dLayer(5,20) batchNormalizationLayer reluLayer transposedConv2dLayer(4,numFilters,'Stride',2,'Cropping',1); convolution2dLayer(5,20) batchNormalizationLayer reluLayer convolution2dLayer(5,20) fullyConnectedLayer(4) softmaxLayer pixelClassificationLayer ] % pxds = pixelLabelDatastore(labelDir,classes,labelIDs); options = trainingOptions('sgdm', ... 'InitialLearnRate',0.01, ... 'MaxEpochs',1, ... 'Shuffle','every-epoch', ... 'ValidationFrequency',30, ... 'Verbose',false); net=trainNetwork(imds,layers,options); res = activations(net,inp,net.Layers(numLayers-1).Name,'OutputAs','channels'); I = read(imds); % C = read(pxds) C = semanticseg(I, net); % Overlay pixel label data on the image and display. B = labeloverlay(I, C); figure(12) imshow(B)
I got error @
Error using trainNetwork
Not enough input arguments.
Error in
net=trainNetwork(imds,layers,options);I
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
In the imageDatastore() function there is an option to specify the reader. For example, try something like: imds = imageDatastore('*.dcm','ReadFcn',@dicomread);
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
In the imageDatastore() function there is an option to specify the reader. For example, try something like:
imds = imageDatastore('*.dcm','ReadFcn',@dicomread);
Comments
Post a Comment