フィルターのクリア

Brace indexing is not supported for variables of this type. Error in Untitled3 (line 7) myfile1 = myfile1{1};

1 回表示 (過去 30 日間)
% 1 step: create slice and save resulting img
% 2 step: run registation
%% create slice and substract dark image
% readim
myfile1 = imread('cam14-blank181112_2018-11-12-115852-0000.jpg');
myfile1 = myfile1{1};
% dark image subtraction
%dark1 = readtimeseries('dark\camera1\camera1_2015-03-28-204209-0000.tif');
%dark1 = dark1{1};
%myfile1 = myfile1 - squeeze(mean(dark1{1},[],3));
%myfile1 = myfile1 - squeeze(mean(dark1));
dark1 = imread('cam14-blankNoLight181112_2018-11-12-120006-0000.jpg');
myfile1 = myfile1 - dark1{1};
imwrite(myfile1,'slice_cam14-blank181112_2018-11-12-115852-0000','JPG',0,[])
myfile2 = imread('cam14-blank181112_2018-11-12-115852-0001.jpg');
myfile2 = myfile2{1};
% dark image subtraction
%dark2 = readtimeseries('dark\camera2\camera2_2015-03-28-204250-0000.tif');
%dark2 = dark2{1};
%myfile2 = myfile2 - squeeze(mean(dark2{1},[],[3 4]));
%myfile2 = myfile2 - squeeze(mean(dark2{1}, [], 3));
dark2 = readim('cam14-blankNoLight181112_2018-11-12-120006-0001.jpg');
myfile2 = myfile2 - dark2{1};
writeim(myfile2,'slice_cam14-blank181112_2018-11-12-115852-0001','JPG',0,[])
%%
[separated,transform]=PreprocessPicoSIM('slice_cam14-blank181112_2018-11-12-115852-0000.jpg', 'slice_cam14-blank181112_2018-11-12-115852-0001.jpg');
%%
% save aligned images
stack=squeeze(separated);
Filebase='stack1\\img%03d.tif';
for num=0:size(stack,3)-1
Filename=sprintf(Filebase,num);
tiffwrite(Filename,squeeze(stack(:,:,num)),'no');
end
% save transformation parameters
% save transform.mat transform
Hello I am Very new to programming please help me out
I got this error while running
Brace indexing is not supported for variables of this type.
Error in Untitled3 (line 7)
myfile1 = myfile1{1};
  2 件のコメント
Geoff Hayes
Geoff Hayes 2019 年 1 月 21 日
Raviteja - the error message is telling you that cannot use braces on the myfile1 variable as you are doing at
myfile1 = myfile1{1};
Since you are using imread, then myfile1 is an Image data, returned as an array. What are you trying to accomplish by accessing this variable in this way? Is there a particular dimension of the image array that you want? Please clarify.
GSN Spidey
GSN Spidey 2020 年 8 月 22 日
So how do we access this then?

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2019 年 1 月 21 日
The imread function returns a numeric array, not a cell. See the documentation section on A (link) in the Output Arguments section.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by