Skip to content
Permalink
Browse files

merged

  • Loading branch information...
aditiiyer committed Mar 21, 2019
1 parent a8fef38 commit f7df4c019191a8c9ede3ef807ae24adcc358e907

This file was deleted.

Oops, something went wrong.
@@ -79,7 +79,7 @@

"colorOrder" : [[0.9, 0.63, 0], [0, 0.9,0], [0.9, 0, 0], [0, 0.81, 0.81], [0.675, 0, 0.6750], [0.675, 0.675, 0], [0.54, 0.675, 0.9], [0.72, 0.225, 0.225], [0.9, 0, 0.9], [0.675, 0.45, 0], [0, 0.9, 0.45], [0.9, 0.45, 0.9], [0.45, 0.9, 0], [0.27, 0, 0.81], [0, 0.63, 0.27], [0.63, 0.27, 0], [0, 0.72, 0.81], [0.63, 0, 0.72], [0.81, 0.54, 0], [0.297, 0.594, 0.9000], [0.9, 0.297, 0.297], [0.9, 0, 0.81], [0.81, 0.45, 0], [0, 0.9, 0.36], [0.81, 0.54, 0.81], [0.54, 0.81, 0], [0.63, 0.36, 0.72], [0.54, 0.81, 0.18]],

"contourToSliceTolerance" : 0.005,
"contourToSliceTolerance" : 0.008,

"inactiveSegStyle" : "--",

@@ -162,7 +162,7 @@ function batch_fuse_atlas_seg(pcDirName,atlasDirName,registeredDirLoc)
greWeightedStrAvgV(~allCandsV) = min(greWeightedStrAvgV);
greDose3M = reshape(greWeightedStrAvgV,uniScanSiz);

threshV = multithresh(greDose3M(:),3); % arbitrary 3 levels. optimize?
threshV = multithresh(greDose3M(:),4); % arbitrary 3 levels. optimize?

% % GRE-weighted average
% indKeepV = sum(strAllM,2) > 3;
@@ -227,11 +227,11 @@ function batch_fuse_atlas_seg(pcDirName,atlasDirName,registeredDirLoc)
scanNum = 1;

% STAPLE
stapleStr3M = reshape(W > 0.8,uniScanSiz);
stapleStr3M = reshape(W > 0.95,uniScanSiz);
%planC = maskToCERRStructure(stapleStr3M,isUniform,scanNum,...
% [structName,'_STAPLE_',num2str(0.9*100),'_pct_conf'],planC);
planC = maskToCERRStructure(stapleStr3M,isUniform,scanNum,...
[structName,'_STAPLE_',num2str(0.8*100),'_pct_conf'],planC);
[structName,'_STAPLE_',num2str(0.95*100),'_pct_conf'],planC);
%--------------------------------%
planC = deleteStructureSegments(length(planC{indexS.structures}),...
0.05,planC);
@@ -1,4 +1,4 @@
function [volToEval,maskBoundingBox3M,mask3M,minr,maxr,minc,maxc,mins,maxs,...
function [volToEval,maskBoundingBox3M,maskC,minr,maxr,minc,maxc,mins,maxs,...
uniqueSlices] = getROI(structNumV,rowMargin,colMargin,slcMargin,planC,randomShiftFlg)
% function [volToEval,maskBoundingBox3M,mask3M,minr,maxr,minc,maxc,mins,maxs,...
% uniqueSlices] = getROI(structNum,rowMargin,colMargin,slcMargin,planC,randomShiftFlg)
@@ -58,17 +58,25 @@
volToEval = double(volToEval);
% Clip low intensities in L-R direction
croppedImg3M = bwareaopen(volToEval > -400, 100);
[~, ~, minc, maxc]= compute_boundingbox(croppedImg3M);
volToEval = volToEval(:,minc:maxc,:);
%Changed AI 12/14/18
[~, ~, minc2, maxc2]= compute_boundingbox(croppedImg3M);
volToEval = volToEval(:,minc2:maxc2,:);
maskBoundingBox3M = volToEval .^ 0;

% Pad the mask in S-I direction
mask3M = mask3M(minr:maxr,minc:maxc,:);
maskSiz = size(mask3M);
minSlc = min(uniqueSlices) - slcMargin;
numPadUp = length(min(uniqueSlices)-1:-1:max(1,minSlc));
maxSlc = max(uniqueSlices) + slcMargin;
numPadDwn = length(max(uniqueSlices)+1:1:min(siz(3),maxSlc));
zeroM = false(maskSiz(1),maskSiz(2));
mask3M = cat(3, repmat(zeroM,[1 1 numPadUp]), mask3M, ...
repmat(zeroM,[1 1 numPadDwn]));
maskC = cell(1,length(structNumV));
for n = 1:length(structNumV)
rasterSegmentsM = getRasterSegments(structNumV(n),planC);
mask3M = false(siz);
[mask,uqslices] = rasterToMask(rasterSegmentsM, scanNum, planC);
mask3M(:,:,uqslices) = mask;
mask3M = mask3M(minr:maxr,minc:maxc,mins:maxs);
mask3M = mask3M(:,minc2:maxc2,:);
maskC{n} = mask3M;
end






@@ -40,6 +40,16 @@
error('unknown position')
end

%--- AI added: ---
%For axial scans, flip L-R
indexS = planC{end};
absAxV = [1 0 0 0 1 0].';
patOrtV = planC{indexS.scan}(1).scanInfo(1).DICOMHeaders.ImageOrientationPatient;
if isequal(absAxV,abs(patOrtV))
mask3M = flip(mask3M,2);
end
%-- end added---

isUniform = 1;
planC = maskToCERRStructure(mask3M,isUniform,scanNum,structName,planC);

@@ -2,6 +2,7 @@
% readXmlHermesStructure.m
%
% APA, 8/31/2017
% AI Addded input scanNum

% maskFileName = 'L:\Data\TCIA_Breast\Ivan\TCGA-AO-A03V\TCGAAOA03VTCGAAO_196070.xml';

@@ -29,7 +30,6 @@
end

% parameters to convert from matrix to physical
%scanNum = 1;
sizV = size(planC{indexS.scan}(scanNum).scanArray);
gridUnitsV = [planC{indexS.scan}(scanNum).scanInfo(1).grid1Units, ...
planC{indexS.scan}(scanNum).scanInfo(1).grid2Units];
@@ -47,7 +47,6 @@
% error('unknown position')
% case 'FFP' %-x,+y,-z
% yV = sizV(1)-yV;
% %xV = sizV(2)-xV;
% otherwise
% error('unknown position')
% end
Oops, something went wrong.

0 comments on commit f7df4c0

Please sign in to comment.
You can’t perform that action at this time.