Creation of a tmp file instead of a vmp file
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am using the code below to create a vmp file, however everytime it gets to the bottom part to SaveAs, it gives me the following error message and is saving the vmp file as a tmp file. I'm not sure how to fix this problem, and why it isn't properly saving all the data. Thanks in advance!!:)
ERROR MESSAGE:
'Error using aft_SaveAs (line 132)
Error saving file C:/Users/ss4404/Desktop/SAMP/Variability_Project/Code/Creating_MDMsGLMs/Brodmann-Area-01/1X1X1.vmp: Error moving file
'C:/Users/ss4404/Desktop/SAMP/Variability_Project/Code/Creating_MDMsGLMs/Brodmann-Area-01/TESTING.vmp.tmp' to
'C:/Users/ss4404/Desktop/SAMP/Variability_Project/Code/Creating_MDMsGLMs/Brodmann-Area-01/TESTING.vmp': Cannot write to destination:
C:\Users\ss4404\Desktop\SAMP\Variability_Project\Code\Creating_MDMsGLMs\Brodmann-Area-01\TESTING.vmp. Use the 'f' option to override...
Error in xff/subsref (line 159)
[varargout{1}] = feval(tfm{6}, xo, fargs{:}); '
HERE IS THE FULL CODE:
%% Grab Data
%This code is for BF analysis on a 2x2 ANOVA
glm = xff('Brodmann_01.glm');
%The first 13 subjects are blind, the next 17 are sighted, therefore I am
%creating two separate groups for them here. Please enter the number of
%subjects you have in each condition here:
num_subj_bl = 13;
num_subj_si = 18;
blind = glm.GLMData.BetaMaps(:,:,:,26:38);
sighted = glm.GLMData.BetaMaps(:,:,:,39:56);
[Dim1, Dim2, Dim3, Dim4] = size(glm.GLMData.BetaMaps);
%The first 12 subjects are blind, the next 13 are sighted, therefore I am
%creating two separate groups for them here. Please enter the number of
%subjects you have in each condition here:
num_subj_bl1 = 12;
num_subj_si1 = 13;
blind1 = glm.GLMData.BetaMaps(:,:,:,1:12);
sighted1 = glm.GLMData.BetaMaps(:,:,:,13:25);
%% Preparing for forloop
%Concatenating the blind and sighted subjects
blind_all = cat(4,blind,blind1);
sighted_all = cat(4,sighted,sighted1);
fmap_BF= zeros(58, 40, 46);
total_subj_bl = 25;
total_subj_si = 31;
% %These are the creating the appropriate strings necessary for anovan analysis
% str1 = [string('Blind')];
% str2 = [string('Sighted')];
% str3 = [string('Rainbow')];
% str4 = [string('PhD')];
% %string for factor 1, blind v sighted
% vision = [repmat(str1,1,25), repmat(str2,1,30)];
% g2 = [repmat(str4,1,13), repmat(str3,1,12)];
% g3 = [repmat(str4,1,17), repmat(str3,1,13)];
% %string for factor 2, rainbow vs PhD cohort
% cohort = [g2 g3];
%% This forloop will loop through all the voxels
for a= 20:25
for b= 20:25
for c= 20:25
%These first 3 forloops loop through each unique voxel in the 175 x 121 X
%139 3D matrix that is generated for each subject
%These forloops loop through each individual subject in the blind and
%sighted conditions and put the corresponding voxels across all the
%subjects in a column vector. Therefore, voxel (1,1,1) across all 12 blind
%subjects will be put in the vector blind_vox and voxel (1,1,1) across all
%13 sighted subjects will be put in the vector sighted_vox.
blind_vox = [];
sighted_vox = [];
for x= 1:total_subj_bl
vox = blind_all(a,b,c,x);
blind_vox = [blind_vox; vox];
end
for y= 1:total_subj_si
vox1= sighted_all(a,b,c,y);
sighted_vox = [sighted_vox; vox1];
end
% %This is creating a response vector for anovan analysis
% data_all = [blind_vox sighted_vox];
% %Running a 2x2 ANOVA on the data using anovan
% [p, tbl] = anovan(data_all,{vision cohort},'model','interaction','varnames',{'vision','cohort'},'display','off');
% %Saving the f stats for the main effects and interaction
% %This is the F stat for blind v sighted
% fstat_gr1 = tbl(2,6);
% fstat1 = cell2mat(fstat_gr1);
% %This is the F stat for cohort type, rainbow vs. PhD
% fstat_gr2 = tbl(3,6);
% fstat2 = cell2mat(fstat_gr2);
% %This is the F stat for the interaction
% fstat_int = tbl(4,6);
% fstat3 = cell2mat(fstat_int);
% Padcat takes the uneven column vectors since they both have a
% different number of subjects and turns them into even column
% vectors by padding the smaller vector with NaN values
vect_for_BF = padcat(blind_vox, sighted_vox);
%This runs the Brown Forsythe test on the 2 column matrix
[p,stats] = vartestn(vect_for_BF,'TestType','BrownForsythe','Display','off');
%This runs a simple 1 way ANOVA on the column vector
%[p,tbl] = anova1(vect_for_BF, [], 'off');
%fstat = tbl{2,5};
%This will contain the f values for all the BF tests run
fmap_BF(a,b,c) = stats.fstat;
end
end
end
%Saving the degrees of freedom
% df = tbl(5,3);
% Put in the data and save
f_Map = xff('1X1X1.vmp');
f_Map.NrOfMaps = 1;
f_Map.Map = f_Map.Map(1);
f_Map.Map(1).Name = 'FMap_BF_2by2_Vision_Brodmann1';
f_Map.Map(1).VMPData = fmap_BF;
f_Map.SaveAs;
%popUp.m
%
% msg = 'All done!';
% title = 'all done!';
% answer = inputdlg(msg,title);
4 comentarios
Walter Roberson
el 15 de Oct. de 2019
What shows up for
fileattrib C:/Users/ss4404/Desktop/SAMP/Variability_Project/Code/Creating_MDMsGLMs/Brodmann-Area-01/TESTING.vmp
fileattrib C:/Users/ss4404/Desktop/SAMP/Variability_Project/Code/Creating_MDMsGLMs/Brodmann-Area-01
Respuestas (0)
Ver también
Categorías
Más información sobre ANOVA en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!