-
Notifications
You must be signed in to change notification settings - Fork 102
Importing Mha
Aditya P. Apte edited this page May 31, 2017
·
4 revisions
% Read .mha file
mhaLocation = 'Path\to\mhaFile\mhaFileName.mha';
Ainfo = mha_read_header(mhaLocation);
A = mha_read_volume(Ainfo);
% mha to cerr conversion
scanOffset = 0;
scanName = 'DECT';
oldPlanC = [];
scanFlag = 0;
planC = mha2cerr(Ainfo,A,scanOffset,scanName,oldPlanC,scanFlag);
% save planC to file
dirName = 'Path\to\store\cerr\file';
cerrFileName = 'cerrFile.mat';
optS = [];
saveflag = 'passed';
fName = fullfile(dirName,cerrFileName);
planC = save_planC(planC,optS,saveflag,fName);
mhaStructLocation = 'Path\to\mhaFile\mhaStructFileName.mha';
[data3M,infoS] = readmha(mhaStructLocation);
data3M = flipdim(flipdim(permute(data3M,[2,1,3]),2),3);
isUniform = 0;
strName = 'from_mha';
strCreationScanNum = 1;
planC = maskToCERRStructure(data3M,isUniform,strCreationScanNum,strName,planC);