├── CWL_Segmentation_3D ├── CWL_likelihood_filtering.m ├── CWL_likelihood_filtering3D.m ├── CWL_likelihood_filteringAx.m ├── CWL_likelihood_filteringAx3D.m ├── CWL_localise.m ├── CWL_localiseAx.m ├── CWL_mapToDepthFieldAx.m ├── CWL_mapTo_d_field.m ├── airBkgSeg.m ├── airBkgSegAx.m ├── biggest3dCCinMaskInit.m ├── boundingBox │ ├── determineBttmBoundAx.m │ ├── determineBttmBound_allFOV.m │ ├── determineBttmBound_bigFOV.m │ ├── determineLateralBound.m │ ├── determineLateralBoundAx.m │ └── determineLateralBoundCore.m ├── colwiseLearn.m ├── colwiseLearn3d.m ├── cutCWL2brst.m ├── dMap.m ├── dMapAx.m ├── dMapEnergy.m ├── dMapEnergyAx.m ├── defineCWL_ROI_wLeftbounds.m ├── extractCWLmap_byMaxResp.m ├── extractCWLmap_byMaxRespAx.m ├── extractLeftBounds.m ├── genBrstMask_from_bodyMask_n_CWLmap.m ├── genBrstMask_from_bodyMask_n_CWLmapAx.m ├── globalAdaptAx.m ├── globalAdaptAx3d.m ├── globalAdaptSag.m ├── globalAdaptSag3d.m ├── inspectFrontBounds.m ├── inspectLeftBounds.m ├── makeISO.m ├── makeISO_Ax.m ├── processInitMask.m ├── processInitMaskAx.m ├── rowwiseLearn.m ├── rowwiseLearn3d.m ├── search_4neareastNeighbors.m ├── showFrontbounds.m ├── showLeftbounds.m ├── verticalRange_sag.m ├── wholeBreastSegmentAx.m └── wholeBreastSegmentSag.m ├── Evaluation └── calMetrics.m ├── FGT_Segmentation_3D ├── masked_feature_01norm.m └── scale01.m ├── MR_startup.m ├── Readme.md ├── common ├── CCFilterKeepLargestN.m ├── CCFilterRemoveSmallOnes.m ├── NeumannBoundCond.m ├── biggestCC.m ├── composeSavename.m ├── imoverlayMathWorks.m ├── kmeanspp.m ├── levelset │ └── normalize01.m ├── reformatAx2Sag.m └── reformatSag2Ax.m ├── demoData ├── AX_T1_BILAT │ ├── ser003img00001.dcm │ ├── ser003img00002.dcm │ ├── ser003img00003.dcm │ ├── ser003img00004.dcm │ ├── ser003img00005.dcm │ ├── ser003img00006.dcm │ ├── ser003img00007.dcm │ ├── ser003img00008.dcm │ ├── ser003img00009.dcm │ ├── ser003img00010.dcm │ ├── ser003img00011.dcm │ ├── ser003img00012.dcm │ ├── ser003img00013.dcm │ ├── ser003img00014.dcm │ ├── ser003img00015.dcm │ ├── ser003img00016.dcm │ ├── ser003img00017.dcm │ ├── ser003img00018.dcm │ ├── ser003img00019.dcm │ ├── ser003img00020.dcm │ ├── ser003img00021.dcm │ ├── ser003img00022.dcm │ ├── ser003img00023.dcm │ ├── ser003img00024.dcm │ ├── ser003img00025.dcm │ ├── ser003img00026.dcm │ ├── ser003img00027.dcm │ ├── ser003img00028.dcm │ ├── ser003img00029.dcm │ ├── ser003img00030.dcm │ ├── ser003img00031.dcm │ ├── ser003img00032.dcm │ ├── ser003img00033.dcm │ ├── ser003img00034.dcm │ ├── ser003img00035.dcm │ ├── ser003img00036.dcm │ ├── ser003img00037.dcm │ ├── ser003img00038.dcm │ ├── ser003img00039.dcm │ ├── ser003img00040.dcm │ ├── ser003img00041.dcm │ ├── ser003img00042.dcm │ ├── ser003img00043.dcm │ ├── ser003img00044.dcm │ ├── ser003img00045.dcm │ ├── ser003img00046.dcm │ ├── ser003img00047.dcm │ ├── ser003img00048.dcm │ ├── ser003img00049.dcm │ ├── ser003img00050.dcm │ ├── ser003img00051.dcm │ ├── ser003img00052.dcm │ ├── ser003img00053.dcm │ ├── ser003img00054.dcm │ ├── ser003img00055.dcm │ ├── ser003img00056.dcm │ ├── ser003img00057.dcm │ ├── ser003img00058.dcm │ ├── ser003img00059.dcm │ ├── ser003img00060.dcm │ ├── ser003img00061.dcm │ ├── ser003img00062.dcm │ ├── ser003img00063.dcm │ ├── ser003img00064.dcm │ ├── ser003img00065.dcm │ ├── ser003img00066.dcm │ ├── ser003img00067.dcm │ ├── ser003img00068.dcm │ ├── ser003img00069.dcm │ ├── ser003img00070.dcm │ ├── ser003img00071.dcm │ ├── ser003img00072.dcm │ ├── ser003img00073.dcm │ ├── ser003img00074.dcm │ ├── ser003img00075.dcm │ ├── ser003img00076.dcm │ ├── ser003img00077.dcm │ ├── ser003img00078.dcm │ ├── ser003img00079.dcm │ ├── ser003img00080.dcm │ ├── ser003img00081.dcm │ ├── ser003img00082.dcm │ ├── ser003img00083.dcm │ ├── ser003img00084.dcm │ ├── ser003img00085.dcm │ ├── ser003img00086.dcm │ ├── ser003img00087.dcm │ ├── ser003img00088.dcm │ ├── ser003img00089.dcm │ ├── ser003img00090.dcm │ ├── ser003img00091.dcm │ ├── ser003img00092.dcm │ ├── ser003img00093.dcm │ ├── ser003img00094.dcm │ ├── ser003img00095.dcm │ ├── ser003img00096.dcm │ ├── ser003img00097.dcm │ ├── ser003img00098.dcm │ ├── ser003img00099.dcm │ ├── ser003img00100.dcm │ ├── ser003img00101.dcm │ ├── ser003img00102.dcm │ ├── ser003img00103.dcm │ ├── ser003img00104.dcm │ ├── ser003img00105.dcm │ ├── ser003img00106.dcm │ ├── ser003img00107.dcm │ ├── ser003img00108.dcm │ ├── ser003img00109.dcm │ ├── ser003img00110.dcm │ ├── ser003img00111.dcm │ ├── ser003img00112.dcm │ ├── ser003img00113.dcm │ ├── ser003img00114.dcm │ ├── ser003img00115.dcm │ ├── ser003img00116.dcm │ ├── ser003img00117.dcm │ ├── ser003img00118.dcm │ ├── ser003img00119.dcm │ ├── ser003img00120.dcm │ ├── ser003img00121.dcm │ ├── ser003img00122.dcm │ ├── ser003img00123.dcm │ ├── ser003img00124.dcm │ ├── ser003img00125.dcm │ ├── ser003img00126.dcm │ ├── ser003img00127.dcm │ ├── ser003img00128.dcm │ ├── ser003img00129.dcm │ ├── ser003img00130.dcm │ ├── ser003img00131.dcm │ ├── ser003img00132.dcm │ ├── ser003img00133.dcm │ ├── ser003img00134.dcm │ ├── ser003img00135.dcm │ ├── ser003img00136.dcm │ ├── ser003img00137.dcm │ ├── ser003img00138.dcm │ ├── ser003img00139.dcm │ ├── ser003img00140.dcm │ ├── ser003img00141.dcm │ ├── ser003img00142.dcm │ ├── ser003img00143.dcm │ ├── ser003img00144.dcm │ ├── ser003img00145.dcm │ ├── ser003img00146.dcm │ ├── ser003img00147.dcm │ ├── ser003img00148.dcm │ ├── ser003img00149.dcm │ ├── ser003img00150.dcm │ ├── ser003img00151.dcm │ ├── ser003img00152.dcm │ ├── ser003img00153.dcm │ ├── ser003img00154.dcm │ ├── ser003img00155.dcm │ ├── ser003img00156.dcm │ ├── ser003img00157.dcm │ ├── ser003img00158.dcm │ ├── ser003img00159.dcm │ ├── ser003img00160.dcm │ ├── ser003img00161.dcm │ ├── ser003img00162.dcm │ ├── ser003img00163.dcm │ ├── ser003img00164.dcm │ ├── ser003img00165.dcm │ ├── ser003img00166.dcm │ ├── ser003img00167.dcm │ ├── ser003img00168.dcm │ ├── ser003img00169.dcm │ ├── ser003img00170.dcm │ ├── ser003img00171.dcm │ ├── ser003img00172.dcm │ ├── ser003img00173.dcm │ ├── ser003img00174.dcm │ ├── ser003img00175.dcm │ ├── ser003img00176.dcm │ ├── ser003img00177.dcm │ ├── ser003img00178.dcm │ ├── ser003img00179.dcm │ ├── ser003img00180.dcm │ ├── ser003img00181.dcm │ ├── ser003img00182.dcm │ ├── ser003img00183.dcm │ ├── ser003img00184.dcm │ ├── ser003img00185.dcm │ ├── ser003img00186.dcm │ ├── ser003img00187.dcm │ ├── ser003img00188.dcm │ ├── ser003img00189.dcm │ ├── ser003img00190.dcm │ ├── ser003img00191.dcm │ └── ser003img00192.dcm └── SAG_T1_3D_BILAT │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000665684776801 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000666605876804 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000673337476807 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000678074076808 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000681911276813 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000687738476814 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000696320676815 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000696646376816 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000816612076828 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000821667976829 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000821899476830 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000827367276833 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000828754076834 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000834022476835 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000845968776840 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000855482876841 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000910058876850 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000912043776853 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000913386176854 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000914159376857 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000916167876858 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000919196676861 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000923195976862 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000931305476865 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000983546776874 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000983922976875 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000985431776878 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000987345776881 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000990612476884 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000991259076885 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312000994970776886 │ ├── MR.1.3.12.2.1107.5.2.31.30667.201411131200103625276889 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001055178676896 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001056162576899 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001056987276904 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001061238876907 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001062472076908 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001062592576909 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001066772976910 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001076233276913 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001121259676922 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001121467276923 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001124051576924 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312001125365376925 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010219709377016 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010235110577025 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010237757777026 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010239735277029 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010244234677030 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010252138577033 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010259301777036 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010265642777037 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010371636977045 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010374457177050 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010382586477051 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010384519377052 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010386822477055 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010395340077056 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010418668477062 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010464978477069 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010467621477072 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010470340277073 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010471420677074 │ ├── MR.1.3.12.2.1107.5.2.31.30667.201411131201047630777061 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010477427777077 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010485097477084 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010485684877085 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010487125577086 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010534493677095 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010537327577096 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010537942577097 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010539598277100 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010545486577101 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010556622477108 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010558502377109 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010559702077110 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010611088077124 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010614584877125 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010631540777130 │ ├── MR.1.3.12.2.1107.5.2.31.30667.201411131201063325677117 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010635299577133 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010638947077134 │ ├── MR.1.3.12.2.1107.5.2.31.30667.201411131201064023877118 │ ├── MR.1.3.12.2.1107.5.2.31.30667.201411131201064615977119 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010668083677141 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010669198277142 │ ├── MR.1.3.12.2.1107.5.2.31.30667.2014111312010670011877145 │ └── MR.1.3.12.2.1107.5.2.31.30667.2014111312010674871877146 ├── imageIO ├── readmri.m └── readmriAx.m └── wholeBreastSegment.m /CWL_Segmentation_3D/CWL_likelihood_filtering.m: -------------------------------------------------------------------------------- 1 | function [respMap,smooth_slices] = CWL_likelihood_filtering(slices,CWL_ROI,leftBounds,half_width,visualize) 2 | %[respMap,smooth_slices]=CWL_LIKELIHOOD_FILTERING(slices,CWL_ROI,leftBounds,half_width,visualize) 3 | 4 | slices = mat2gray(slices); 5 | [row,col,slc] = size(slices); 6 | 7 | % smoothing valid/given slices one by one 8 | smooth_slices = zeros(row,col,slc); 9 | for i = 1:slc 10 | % w = 5; % bilateral filter half-width 11 | % sigma = [3 0.1]; % bilateral filter standard deviations 12 | % smooth_slices(:,:,i) = bfilter2(slices(:,:,i),w,sigma); 13 | % smooth_slices(:,:,i) = anisodiff(slices(:,:,i), 30, 20, 0.1, 1); 14 | smooth_slices(:,:,i) = wiener2(slices(:,:,i),[7 7]); 15 | end 16 | 17 | piece_len = 2*half_width + 1; 18 | % template = [ones(1,half_width) -ones(1,half_width+1)]; 19 | n = row*col*slc; 20 | % tic 21 | k = 2^22; 22 | if k>n 23 | k = n; 24 | end 25 | p = randperm(n,k); % have to do random sampling when data is too big 26 | [~,C]=kmeanspp(smooth_slices(p),3); 27 | % kmeans_of_random_samples = toc 28 | C=sort(C); 29 | template = [C(3)*ones(1,half_width-1), (C(3)+C(1))/2, C(1), (C(2)+C(1))/2, C(2)*ones(1,half_width-1)]; 30 | template = repmat(template,piece_len,1); 31 | % % visual display codes that generate figure for paper 32 | % imwrite(template,'generic_template.png'); 33 | template = template - mean(template(:)); % shift mean to 0 34 | % % normalize self response to 1; needed in matching filtering ONLY 35 | % factorsquare = sum(template(:).^2); 36 | % template = template/sqrt(factorsquare); 37 | % rightside = [zeros(1,half_width+1) ones(1,half_width)/half_width]; 38 | % rightside = repmat(rightside,piece_len,1); 39 | 40 | % slice-wise filtering 41 | respMap = zeros(row,col,slc); 42 | % fun = @(x) rawDist(x,template); 43 | for i = 1:slc 44 | if leftBounds(i)>0 % skip slices that do not contain breast 45 | ROI = smooth_slices(:,leftBounds(i)-half_width:end,i); 46 | rawresp = imfilter(ROI, template, 'replicate'); 47 | % rightresp = imfilter(ROI, rightside, 'replicate'); 48 | % rawresp = nlfilter(ROI,[size(template,1) size(template,2)],fun); 49 | % rawresp = matchingFiltering(ROI, template, 15); 50 | % rawresp = rawresp.*rightresp; 51 | respMap(:,leftBounds(i):end,i) = rawresp(:,1+half_width:end); 52 | end 53 | end 54 | % NOTE: [0,1] scaling should only be done after dark preference 55 | % multiplication; confirmed by experiments! 56 | respMap = respMap .* (1-smooth_slices); % favor dark pixels 57 | % scale using responses only within ROI 58 | respMap = masked_feature_01norm(respMap, CWL_ROI); 59 | respMap(~CWL_ROI) = 0; 60 | 61 | % visual debug codes 62 | if exist('visualize', 'var') && visualize 63 | implay([mat2gray(slices) ones(row,1,slc) respMap]); 64 | end 65 | 66 | end 67 | 68 | function t=NCC(V,U) 69 | Vvar=V-mean(V(:)); Uvar=U-mean(U(:)); 70 | I=(Vvar.*Uvar)/((sqrt(sum(Vvar(:).^2))*sqrt(sum(Uvar(:).^2)))+eps); 71 | t=sum(I(:))/numel(I); 72 | end 73 | 74 | function d = rawDist(V,U) 75 | d = sum(abs(V(:)-U(:))); 76 | end 77 | 78 | function responsemap = matchingFiltering(img, K, step) 79 | theta = -30:step:30; 80 | responsemapmx = zeros([size(img) numel(theta)]); % pre-allocation of memory 81 | for i = 1:numel(theta) 82 | K1 = imrotate(K, theta(i), 'bilinear'); 83 | K1 = K1 - mean(K1(:)); % shift mean to 0 84 | factorsquare = sum(K1(:).^2); 85 | K1 = K1/sqrt(factorsquare); 86 | responsemapmx(:,:,i) = imfilter(img, K1, 'replicate'); 87 | end 88 | 89 | responsemap = max(responsemapmx, [], 3); 90 | end 91 | 92 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_likelihood_filtering3D.m: -------------------------------------------------------------------------------- 1 | function [respMap,smooth_slices] = CWL_likelihood_filtering3D(slices,CWL_ROI,leftBounds,half_width,visualize) 2 | %[respMap,smooth_slices]=CWL_LIKELIHOOD_FILTERING3D(slices,CWL_ROI,leftBounds,half_width,visualize) 3 | 4 | slices = mat2gray(slices); 5 | [row,col,slc] = size(slices); 6 | 7 | % smoothing valid/given slices one by one 8 | smooth_slices = zeros(row,col,slc); 9 | for i = 1:slc 10 | % w = 5; % bilateral filter half-width 11 | % sigma = [3 0.1]; % bilateral filter standard deviations 12 | % smooth_slices(:,:,i) = bfilter2(slices(:,:,i),w,sigma); 13 | % smooth_slices(:,:,i) = anisodiff(slices(:,:,i), 30, 20, 0.1, 1); 14 | smooth_slices(:,:,i) = wiener2(slices(:,:,i),[7 7]); 15 | end 16 | 17 | cubic_len = 2*half_width + 1; 18 | n = row*col*slc; 19 | % tic 20 | k = 2^22; 21 | if k>n 22 | k = n; 23 | end 24 | p = randperm(n,k); % have to do random sampling when data is too big 25 | [~,C]=kmeanspp(smooth_slices(p),3); 26 | % kmeans_of_random_samples = toc 27 | C=sort(C); 28 | template = [C(3)*ones(1,half_width-1), (C(3)+C(1))/2, C(1), (C(2)+C(1))/2, C(2)*ones(1,half_width-1)]; 29 | template = template - mean(template(:)); % shift mean to 0 30 | template = repmat(template,cubic_len,1,cubic_len); 31 | 32 | respMap = imfilter(smooth_slices, template, 'replicate'); 33 | % NOTE: [0,1] scaling should only be done after dark preference 34 | % multiplication; confirmed by experiments! 35 | respMap = respMap.*(1-smooth_slices); % favor dark pixels 36 | % scale using responses only within ROI 37 | respMap = masked_feature_01norm(respMap, CWL_ROI); 38 | respMap(~CWL_ROI) = 0; % null response outside ROI 39 | 40 | % visual debug codes 41 | if exist('visualize', 'var') && visualize 42 | implay([mat2gray(slices) ones(row,1,slc) respMap]); 43 | end 44 | 45 | end 46 | 47 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_likelihood_filteringAx.m: -------------------------------------------------------------------------------- 1 | function [respMap,smooth_slices] = CWL_likelihood_filteringAx(slices,CWL_ROI,frontBounds,half_height,dispOpt) 2 | %[respMap,smooth_slices]=CWL_LIKELIHOOD_FILTERINGAX(slices,CWL_ROI,leftBounds,half_height,dispOpt) 3 | 4 | slices = mat2gray(slices); 5 | [row,col,slc] = size(slices); 6 | 7 | % smoothing valid/given slices one by one 8 | smooth_slices = zeros(row,col,slc); 9 | for i = 1:slc 10 | % w = 5; % bilateral filter half-width 11 | % sigma = [3 0.1]; % bilateral filter standard deviations 12 | % smooth_slices(:,:,i) = bfilter2(slices(:,:,i),w,sigma); 13 | % smooth_slices(:,:,i) = anisodiff(slices(:,:,i), 30, 20, 0.1, 1); 14 | smooth_slices(:,:,i) = wiener2(slices(:,:,i),[7 7]); 15 | end 16 | 17 | piece_width = 2*half_height + 1; 18 | % template = [ones(1,half_height) -ones(1,half_height+1)]; 19 | n = row*col*slc; 20 | % tic 21 | k = 2^22; 22 | if k>n 23 | k = n; 24 | end 25 | p = randperm(n,k); % have to do random sampling when data is too big 26 | [~,C]=kmeanspp(smooth_slices(p),3); 27 | % kmeans_of_random_samples = toc 28 | C=sort(C); 29 | template = [C(3)*ones(half_height-1,1); (C(3)+C(1))/2; C(1); (C(2)+C(1))/2; C(2)*ones(half_height-1,1)]; 30 | template = template - mean(template(:)); % shift mean to 0 31 | template = repmat(template,1,piece_width); 32 | % % normalize self response to 1; needed in matching filtering ONLY 33 | % factorsquare = sum(template(:).^2); 34 | % template = template/sqrt(factorsquare); 35 | % rightside = [zeros(1,half_width+1) ones(1,half_width)/half_width]; 36 | % rightside = repmat(rightside,piece_len,1); 37 | 38 | respMap = zeros(row,col,slc); 39 | % fun = @(x) rawDist(x,template); 40 | for i = 1:slc 41 | if frontBounds(i)>0 % only filter slices that contain breast 42 | ROI = smooth_slices(frontBounds(i)-half_height:end,:,i); 43 | rawresp = imfilter(ROI, template, 'replicate'); 44 | % rightresp = imfilter(ROI, rightside, 'replicate'); 45 | % rawresp = nlfilter(ROI,[size(template,1) size(template,2)],fun); 46 | % rawresp = matchingFiltering(ROI, template, 15); 47 | rawresp = rawresp.*(1-ROI); %.*rightresp; % favor dark pixels 48 | respMap(frontBounds(i):end,:,i) = rawresp(1+half_height:end,:); 49 | end 50 | end 51 | amin = min(respMap(CWL_ROI)); 52 | amax = max(respMap(CWL_ROI)); 53 | respMap = mat2gray(respMap,[amin amax]); 54 | respMap(~CWL_ROI) = 0; 55 | 56 | % visual debug codes 57 | if exist('dispOpt', 'var') && dispOpt 58 | implay([mat2gray(slices) ones(row,1,slc) respMap]); 59 | end 60 | 61 | end 62 | 63 | function t=NCC(V,U) 64 | Vvar=V-mean(V(:)); Uvar=U-mean(U(:)); 65 | I=(Vvar.*Uvar)/((sqrt(sum(Vvar(:).^2))*sqrt(sum(Uvar(:).^2)))+eps); 66 | t=sum(I(:))/numel(I); 67 | end 68 | 69 | function d = rawDist(V,U) 70 | d = sum(abs(V(:)-U(:))); 71 | end 72 | 73 | function responsemap = matchingFiltering(img, K, step) 74 | theta = -30:step:30; 75 | responsemapmx = zeros([size(img) numel(theta)]); % pre-allocation of memory 76 | for i = 1:numel(theta) 77 | K1 = imrotate(K, theta(i), 'bilinear'); 78 | K1 = K1 - mean(K1(:)); % shift mean to 0 79 | factorsquare = sum(K1(:).^2); 80 | K1 = K1/sqrt(factorsquare); 81 | responsemapmx(:,:,i) = imfilter(img, K1, 'replicate'); 82 | end 83 | 84 | responsemap = max(responsemapmx, [], 3); 85 | end 86 | 87 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_likelihood_filteringAx3D.m: -------------------------------------------------------------------------------- 1 | function [respMap,smooth_slices] = CWL_likelihood_filteringAx3D(slices,CWL_ROI,frontBounds,half_height,dispOpt) 2 | %[respMap,smooth_slices]=CWL_LIKELIHOOD_FILTERINGAX(slices,CWL_ROI,half_height,dispOpt) 3 | 4 | slices = mat2gray(slices); 5 | [row,col,slc] = size(slices); 6 | 7 | % smoothing valid/given slices one by one 8 | smooth_slices = zeros(row,col,slc); 9 | for i = 1:slc 10 | % w = 5; % bilateral filter half-width 11 | % sigma = [3 0.1]; % bilateral filter standard deviations 12 | % smooth_slices(:,:,i) = bfilter2(slices(:,:,i),w,sigma); 13 | % smooth_slices(:,:,i) = anisodiff(slices(:,:,i), 30, 20, 0.1, 1); 14 | smooth_slices(:,:,i) = wiener2(slices(:,:,i),[7 7]); 15 | end 16 | % smooth_slices = smooth3(slices, 'gaussian'); 17 | 18 | cubic_len = 2*half_height + 1; 19 | num_voxels = row*col*slc; 20 | % tic 21 | num_samples = 2^22; 22 | if num_samples>num_voxels 23 | num_samples = num_voxels; 24 | end 25 | p = randperm(num_voxels,num_samples); % have to randomly sample when data is too big 26 | [~,centers]=kmeanspp(smooth_slices(p),3); 27 | % kmeans_of_random_samples = toc 28 | centers=sort(centers); 29 | template = [centers(3)*ones(half_height-1,1); (centers(3)+centers(1))/2; centers(1); (centers(2)+centers(1))/2; centers(2)*ones(half_height-1,1)]; 30 | template = template - mean(template(:)); % shift mean to 0 31 | template = repmat(template,1,cubic_len,cubic_len); 32 | 33 | respMap = imfilter(smooth_slices, template, 'replicate'); 34 | % NOTE: [0,1] scaling should only be done after dark preference 35 | % multiplication; confirmed by experiments! 36 | respMap = respMap.*(1-smooth_slices); % favor dark pixels 37 | % scale using responses only within ROI 38 | amin = min(respMap(CWL_ROI)); 39 | amax = max(respMap(CWL_ROI)); 40 | respMap = mat2gray(respMap,[amin amax]); 41 | respMap(~CWL_ROI) = 0; % null response outside ROI 42 | 43 | % visual debug codes 44 | if exist('dispOpt', 'var') && dispOpt 45 | implay([mat2gray(slices) ones(row,1,slc) respMap]); 46 | end 47 | 48 | end 49 | 50 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_localise.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/CWL_localise.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_localiseAx.m: -------------------------------------------------------------------------------- 1 | function [CWLs,CWL_map] = CWL_localiseAx(validSlcID,index1,index2,slices,spacing,CWL_ROI,frontBounds,filter_size_half,lambdaAdjuster,iso_spacing,dimension,visualize) 2 | %CWL_LOCALISEAX Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | % parse inputs 6 | if ~exist('visualize', 'var') 7 | visualize = false; 8 | end 9 | 10 | % find the lateral bounds to cut matrices to pass into subsequent function 11 | lateral_lb = min(index1); 12 | lateral_ub = max(index2); 13 | 14 | d = dMapAx(slices(:,lateral_lb:lateral_ub,validSlcID),spacing, ... 15 | CWL_ROI(:,lateral_lb:lateral_ub,validSlcID),frontBounds(validSlcID), ... 16 | filter_size_half,lambdaAdjuster,iso_spacing,dimension,visualize); 17 | 18 | CWLs = cell(size(slices,3),1); 19 | for i = 1:size(d,2) 20 | CWLs{validSlcID(i)} = [transpose(lateral_lb:lateral_ub) d(:,i)]; 21 | end 22 | 23 | [row,col,slc] = size(slices); 24 | CWL_map = false(row,col,slc); 25 | [slcSub,colSub] = meshgrid(validSlcID,lateral_lb:lateral_ub); 26 | CWL_map(sub2ind([row,col,slc],round(d(:)),colSub(:),slcSub(:)))... 27 | = true; 28 | 29 | % visual debug codes 30 | if exist('visualize','var') && visualize 31 | slices_4disp = mat2gray(slices); 32 | slices_4disp(CWL_map) = 1; 33 | implay(slices_4disp); 34 | end 35 | 36 | end 37 | 38 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_mapToDepthFieldAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/CWL_mapToDepthFieldAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/CWL_mapTo_d_field.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/CWL_mapTo_d_field.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/airBkgSeg.m: -------------------------------------------------------------------------------- 1 | function [mask_init,validSlc,validRow] = airBkgSeg(slices,spacing,szThresh,htThresh) 2 | %[mask_init,validSlc,validRow]=AIR_BKG_SEG(slices,spacing,szThresh,htThresh) 3 | % identifies air/background regions and returns a mask excluding them. 4 | % INPUTS: 5 | % - szThresh: area size threshold in determining if a connected component 6 | % belongs to the initial body mask, in cm2 7 | % - htThresh: height threshold in determining if connected component 8 | % belongs to the initial body mask, in terms of ratio w.r.t the no. of 9 | % image rows 10 | 11 | % parse inputs 12 | if ~exist('szThresh', 'var') 13 | szThresh = 2^2; 14 | end 15 | if ~exist('htThresh', 'var') 16 | htThresh = 1/3; 17 | end 18 | 19 | pxsize = prod(spacing(1:2)/10); % pixel size in cm2 20 | 21 | % use double-precision data remapped to [0,1] for processing 22 | slices = mat2gray(slices); 23 | 24 | [row,col,slc] = size(slices); 25 | 26 | fprintf('### Air/Background Removal Module ###\n'); 27 | 28 | % pure intensity-based thresholding -- uncomment to use 29 | % thresh = graythresh(slices); 30 | % thresh = air_threshold_calc(slices); 31 | % mask_bright = slices>=thresh; 32 | 33 | % 2-d slice-wise filtering 34 | averageMat = slices; 35 | entropyMat = slices; 36 | for i = 1:slc 37 | averageMat(:,:,i) = imfilter(slices(:,:,i), fspecial('gaussian',[3 3], .5)); 38 | entropyMat(:,:,i) = stdfilt(slices(:,:,i), ones(3)); 39 | end 40 | 41 | % 3-d filtering 42 | % averageMat = smooth3(slices, 'gaussian'); 43 | % entropyMat = stdfilt(slices, ones(3,3,3)); 44 | 45 | % clustering 46 | % [ctr, pstr] = fcm(averageMat(:), 2); 47 | % [ctr, pstr] = fcm([averageMat(:),entropyMat(:)], 4); 48 | % [~,cls] = max(pstr); 49 | % [cls, ctr] = kmeans([averageMat(:),entropyMat(:)], 4, 'MaxIter', 200); 50 | % [~,cen] = min(ctr(:,1)); 51 | [cls, ctr] = kmeanspp([averageMat(:),entropyMat(:)]', 4); 52 | [~,cen] = min(ctr(1,:)); 53 | mask_bright = false(row,col,slc); 54 | mask_bright(:) = ~(cls==cen); 55 | 56 | % 3D morphological processing to keep only the largest CC 57 | mask_init = biggest3dCCinMaskInit(mask_bright); 58 | m = mean(slices(mask_init)); 59 | sd = std(slices(mask_init)); 60 | 61 | % iterative 2D+3D morphing 62 | converged = false; 63 | SE = strel('disk',3); 64 | for iter = 1:15 65 | mask_ctrl = mask_init; 66 | 67 | % Slice-wise 2D morphological processing 68 | for i = 1:slc 69 | if any(any(mask_init(:,:,i))) % only process slices with suspect breast 70 | % break narrow connections before morph operations 71 | mask_slc = imerode(mask_init(:,:,i),SE); 72 | CC = bwconncomp(mask_slc,4); 73 | if CC.NumObjects<1 % in case nothing left after erosion 74 | mask_init(:,:,i) = false; 75 | continue; 76 | end 77 | 78 | numPixels = cellfun(@numel, CC.PixelIdxList); 79 | [numPixels, idx] = sort(numPixels, 'descend'); 80 | mask_slc(:) = false; 81 | 82 | % Keep only the largest two components in every slice; used two (2) 83 | % instead of one due to potentially large breasts and/or skin folding 84 | [CCPixelRsub,~] = ind2sub([row col],CC.PixelIdxList{idx(1)}); 85 | if pxsize*numPixels(1)>szThresh && range(CCPixelRsub)/row>htThresh 86 | mask_slc(CC.PixelIdxList{idx(1)}) = true; 87 | else 88 | mask_init(:,:,i) = false; 89 | continue; 90 | end 91 | % comment codes below to keep only the largest CC 92 | if CC.NumObjects>1 && pxsize*numPixels(2)>szThresh 93 | if mean(CC.PixelIdxList{idx(2)}) > mean(CC.PixelIdxList{idx(1)}) 94 | % in case the 2nd largest CC is actually body region 95 | mask_slc(CC.PixelIdxList{idx(2)}) = true; 96 | else 97 | mask_cand = false(row,col); 98 | mask_cand(CC.PixelIdxList{idx(2)}) = true; 99 | slice = slices(:,:,i); 100 | if ~isAttachedPect(mask_cand,mask_slc) && mean(slice(mask_cand))>(m-sd/2) % the 2nd largest CC should not be dark ghost 101 | mask_slc = mask_slc | mask_cand; 102 | end 103 | end 104 | end 105 | mask_slc = imfill(imdilate(mask_slc,SE), 'holes'); 106 | % figure(1); 107 | % imshow(mask_slc); 108 | % pause; 109 | mask_init(:,:,i) = mask_slc; 110 | end 111 | end 112 | 113 | % Then 3D morphological processing again to keep only the largest CC 114 | mask_init = biggest3dCCinMaskInit(mask_init); 115 | 116 | if isequal(mask_ctrl, mask_init) 117 | disp(['Converged at Iter ' num2str(iter) '.']); 118 | converged = true; 119 | break 120 | end 121 | end 122 | 123 | if ~converged 124 | warning('The iterative morph process did not converge.'); 125 | end 126 | 127 | % get indices of valid slices that contain breast 128 | validSlc = transpose( find(any(any(mask_init,1),2)) ); 129 | 130 | % get row range of mask_init in valid slices 131 | validRow = verticalRange_sag(mask_init(:,:,validSlc)); 132 | 133 | end 134 | 135 | function YN = isAttachedPect(mask_cand,mask_slc) 136 | [r1,c1] = find(mask_slc); 137 | [r2,c2] = find(mask_cand); 138 | % Is the candidate shorter than the main component? 139 | if (max(r2)-min(r2))>=(max(r1)-min(r1)) 140 | YN = false; 141 | return; 142 | end 143 | 144 | % Is the candidate strictly to the right of the main component? 145 | c1 = c1(r1<=max(r2)&r1>=min(r1)); 146 | if mean(c2)<=mean(c1) 147 | YN = false; 148 | else 149 | YN = true; 150 | end 151 | 152 | end 153 | 154 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/airBkgSegAx.m: -------------------------------------------------------------------------------- 1 | function [mask_init,validSlc,index1,index2] = airBkgSegAx(slices,rightInd,leftInd,spacing,AThresh,N) 2 | %[mask_init,validSlc,index1,index2] = air_bkg_segAx(slices,rightInd,leftInd,spacing,AThresh,N) 3 | 4 | pixelA = prod(spacing(1:2)/10); % pixel size in cm2 5 | 6 | % parse inputs 7 | if ~exist('AThresh','var') 8 | AThresh = 2.5^2; % default area threashold in cm2 9 | end 10 | if ~exist('N','var') 11 | N = 3; 12 | end 13 | 14 | % use double-precision data remapped to [0,1] for processing 15 | slices = normalize01(slices); 16 | 17 | [row,col,slc] = size(slices); 18 | 19 | fprintf('### Air/Background Removal Module ###\n'); 20 | 21 | % pure intensity-based thresholding -- uncomment to use 22 | % thresh = graythresh(slices); 23 | % thresh = air_threshold_calc(slices); 24 | % mask_bright = slices>=thresh; 25 | 26 | % clustering 27 | % % old codes below for slice-wise filtering 28 | % smoothMat = slices; 29 | % stdMat = slices; 30 | % for i = 1:slc 31 | % smoothMat(:,:,i) = imfilter(slices(:,:,i), fspecial('gaussian',[3 3], .5)); 32 | % stdMat(:,:,i) = stdfilt(slices(:,:,i), ones(3)); 33 | % end 34 | 35 | % [ctr, pstr] = fcm(averageMat(:), 2); 36 | % [ctr, pstr] = fcm([averageMat(:),entropyMat(:)], 4); 37 | % [~,cls] = max(pstr); 38 | % [cls, ctr] = kmeans([averageMat(:),entropyMat(:)], 4, 'MaxIter', 200); 39 | % [~,cen] = min(ctr(:,1)); 40 | 41 | % tried to add [x y z] coordinates for clustering; however, it didn't work 42 | % out 43 | % [X,Y,Z] = meshgrid(1:col, 1:row, 1:slc); 44 | % X = X/max(X(:)) * 1e-1; 45 | % Y = Y/max(Y(:)) * 1e-1; 46 | % Z = Z/max(Z(:)) * 1e-1; 47 | 48 | smoothMat = smooth3(slices, 'gaussian'); 49 | stdMat = stdfilt(slices, ones(3,3,3)); 50 | % [cls, ctr] = kmeanspp(smoothMat(:)', 2); % pure intensity based clustering 51 | [cls, ctr] = kmeanspp([smoothMat(:),stdMat(:)]', 4); 52 | [~,cen] = min(ctr(1,:)); 53 | mask_bright = false(row,col,slc); 54 | mask_bright(:) = ~(cls==cen); 55 | 56 | % 3D morphological processing to keep only the largest CC 57 | mask_init = biggest3dCCinMaskInit(mask_bright); 58 | m = mean(slices(mask_init)); 59 | sd = std(slices(mask_init)); 60 | 61 | % iterative 2D+3D morphing 62 | converged = false; 63 | SE = strel('disk',3); 64 | for iter = 1:12 65 | mask_ctrl = mask_init; 66 | 67 | % Slice-wise 2D morphological processing 68 | for i = 1:slc 69 | if any(any(mask_init(:,:,i))) % only process slices with suspect breast 70 | % break narrow connections before morph operations 71 | mask_slc = imerode(mask_init(:,:,i),SE); 72 | CC = bwconncomp(mask_slc,4); 73 | if CC.NumObjects<1 % in case nothing left after erosion 74 | mask_init(:,:,i) = false; 75 | continue; 76 | end 77 | 78 | numPixels = cellfun(@numel, CC.PixelIdxList); 79 | [numPixels, idx] = sort(numPixels, 'descend'); 80 | mask_slc(:) = false; 81 | 82 | % Keep only the largest three components in every slice; used 3 83 | % instead of one due to potentially large breasts and/or skin folding 84 | % [CCPixelRsub,~] = ind2sub([row col],CC.PixelIdxList{idx(1)}); 85 | % htThresh = .5; 86 | if pixelA*numPixels(1)>AThresh %&& range(CCPixelRsub)/row>htThresh 87 | mask_slc(CC.PixelIdxList{idx(1)}) = true; 88 | else 89 | mask_init(:,:,i) = false; 90 | continue; 91 | end 92 | N_i = min(CC.NumObjects, N); 93 | for n = 2:N_i 94 | mask_major = mask_slc; 95 | if pixelA*numPixels(n)>AThresh 96 | mask_cand = false(row,col); 97 | mask_cand(CC.PixelIdxList{idx(n)}) = true; 98 | slice = slices(:,:,i); 99 | if isBrst(mask_cand, mask_major) && mean(slice(mask_cand))>(m-2*sd) % the 2nd & 3rd largest CC should not be dark ghost 100 | mask_slc = mask_slc | mask_cand; 101 | end 102 | end 103 | end 104 | mask_slc = imfill(imdilate(mask_slc,SE), 'holes'); 105 | % figure(1); 106 | % imshow(mask_slc); 107 | % pause; 108 | mask_init(:,:,i) = mask_slc; 109 | end 110 | end 111 | 112 | % Then 3D morphological processing again to keep only the largest CC 113 | mask_init = biggest3dCCinMaskInit(mask_init); 114 | 115 | if isequal(mask_ctrl, mask_init) 116 | disp(['Converged at Iter ' num2str(iter) '.']); 117 | converged = true; 118 | break 119 | end 120 | end 121 | 122 | if ~converged 123 | warning('The iterative morph process did not converge.'); 124 | end 125 | 126 | % get indices of valid slices that contain breast 127 | validSlc = transpose( find(any(any(mask_init,1),2)) ); 128 | 129 | % find the lateral bounds containing breasts 130 | linearInd = find(mask_init(:,:,validSlc)); 131 | [~,subCol,~] = ind2sub(size(mask_init(:,:,validSlc)), linearInd); 132 | subCol = transpose(unique(subCol)); 133 | index1 = subCol(subCol<=max(rightInd)); 134 | index2 = subCol(subCol>=min(leftInd)); 135 | 136 | end 137 | 138 | function [true_or_false]=isBrst(mask_cand, mask_main) 139 | % a simple function that judges if a small CC belongs to breast based on 140 | % relative position 141 | [r_cand,c_cand] = find(mask_cand); 142 | [r_main,c_main] = find(mask_main); 143 | 144 | [r_cand_min, i_cand_min] = min(r_cand); 145 | c_cand_min = c_cand(i_cand_min); 146 | r_main_col = r_main(c_main==c_cand_min); 147 | if ~isempty(r_main_col) && r_cand_min > max(r_main_col) 148 | true_or_false = false; 149 | else 150 | true_or_false = true; 151 | end 152 | 153 | end 154 | 155 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/biggest3dCCinMaskInit.m: -------------------------------------------------------------------------------- 1 | function [BW] = biggest3dCCinMaskInit(BW) 2 | %BIGGEST3DCCINMASKINIT 3D morphological processing which keeps only the 3 | %biggest CC in BW 4 | % Detailed explanation goes here 5 | 6 | SE = true(3,3,3); 7 | 8 | BW = imerode(BW,SE); % break narrow connections before morph operations 9 | CC = bwconncomp(BW); % find connected components 10 | 11 | % Find and keep only the largest component 12 | numPixels = cellfun(@numel, CC.PixelIdxList); 13 | [~, idx] = max(numPixels); 14 | BW(:) = false; 15 | BW(CC.PixelIdxList{idx}) = true; 16 | 17 | BW = imdilate(BW,SE); % restore the 3D volume 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineBttmBoundAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/boundingBox/determineBttmBoundAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineBttmBound_allFOV.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/boundingBox/determineBttmBound_allFOV.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineBttmBound_bigFOV.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/boundingBox/determineBttmBound_bigFOV.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineLateralBound.m: -------------------------------------------------------------------------------- 1 | function [validSlc,validRow] = determineLateralBound(laterality,portion,masks,slices,spacing,validSlc,validRow,visualize) 2 | %[validSlc,validRow]=DETERMINEOUTERBOUND(laterality,portion,masks,slices,spacing,validSlc,validRow[,visualize=false]) 3 | % Detailed explanation goes here 4 | 5 | if ~exist('visualize','var') 6 | visualize = false; 7 | end 8 | 9 | % call the mutual core function shared from axial view, using arguments 10 | % re-arranged from sagittal to axial view (slices, masks and valid rows) 11 | validRow = size(masks, 1) - validRow(end:-1:1) + 1; 12 | [validSlc,validRow] = determineLateralBoundCore(laterality,portion,reformatSag2Ax(masks>0),... 13 | reformatSag2Ax(slices),[spacing(2),spacing(3),spacing(1)],validSlc,validRow,visualize); 14 | validRow = size(masks, 1) - validRow(end:-1:1) + 1; 15 | 16 | end 17 | 18 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineLateralBoundAx.m: -------------------------------------------------------------------------------- 1 | function [validSlc,validCol1,validCol2] = determineLateralBoundAx(portion,masks,slices,spacing,rightInd,leftInd,validSlc,validCol1,validCol2,visualize) 2 | %[validSlc,validCol1,validCol2]=DETERMINELATERALBOUNDAX(portion,masks,slices,spacing,rightInd,leftInd,validSlc,validCol1,validCol2,visualize) 3 | % INPUT 4 | % portion: 'outer' / 'inner' 5 | 6 | % parse inputs 7 | if ~exist('visualize', 'var') 8 | visualize = false; 9 | end 10 | 11 | % two breasts are processed seperately 12 | 13 | % right breast first 14 | [validCol1,validSlc1] = determineLateralBoundCore('right',portion,masks(:,rightInd,:),... 15 | slices(:,rightInd,:),spacing,validCol1,validSlc,visualize); 16 | 17 | % then left breast 18 | [validCol2,validSlc2] = determineLateralBoundCore('left',portion,masks(:,leftInd,:),... 19 | slices(:,leftInd,:),spacing,validCol2-max(rightInd),validSlc,visualize); 20 | validCol2 = validCol2 + max(rightInd); 21 | 22 | % union valid slices range 23 | validSlc = union(validSlc1, validSlc2); 24 | 25 | end 26 | 27 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/boundingBox/determineLateralBoundCore.m: -------------------------------------------------------------------------------- 1 | function [validCol,validSlc] = determineLateralBoundCore(laterality,portion,masks,slices,spacing,validCol,validSlc,visualize) 2 | %[validSlc,validRow]=DETERMINEOUTERBOUNDCORE(laterality,portion,masks,slices,spacing,validCol,validRow[,visualize=false]) 3 | % Determines breast lateral bounds in axial view 4 | 5 | % find out whether we'll cut off the end with lower indices, or the other 6 | if strcmpi(laterality, 'right') && strcmpi(portion, 'inner') ... 7 | || strcmpi(laterality, 'left') && strcmpi(portion, 'outer') 8 | cutoffLowEnd = false; 9 | elseif strcmpi(laterality, 'right') && strcmpi(portion, 'outer') ... 10 | || strcmpi(laterality, 'left') && strcmpi(portion, 'inner') 11 | cutoffLowEnd = true; 12 | else 13 | error('Invalid laterality or portion indicated. Please check your inputs and try again.'); 14 | end 15 | 16 | % the empirical nipple region to be excluded from cut; for our data we do 17 | % not find it necessary so we set it to 0 18 | nipple_r = 0; % radius of the nipple region in mm 19 | nipple_r = round(nipple_r/spacing(2)); % convert it to pixel 20 | 21 | % find silhouette of breast by mask projection 22 | silhouette = max(masks,[],3); 23 | if cutoffLowEnd % if we are cuting off the end with lower indices 24 | % flip the silhouette so that we can reuse the codes written for 25 | % cutting off the other end (i.e., the higher-indexed end) 26 | silhouette = fliplr(silhouette); 27 | validCol = size(silhouette, 2) - validCol(end:-1:1) + 1; 28 | end 29 | 30 | % find the front surface 31 | front_curve = zeros(numel(validCol), 2); 32 | for j = 1:numel(validCol) 33 | front_curve(j,:) = [validCol(j) find(silhouette(:,validCol(j)),1,'first')]; 34 | end 35 | B = bwtraceboundary(silhouette, fliplr(front_curve(end,:)), 'SW', 8, Inf); 36 | idx = find(B(:,1)==front_curve(1,2) & B(:,2)==front_curve(1,1)); 37 | if isempty(idx) || numel(idx)>1 38 | error('Sth went wrong.'); 39 | end 40 | back_curve = fliplr(B(1:idx, :)); 41 | 42 | % generate a new mask with front_curve and back_curve; this 'mask' is 43 | % different from the 'silhouette' in that it is convex in the front surface 44 | mask = poly2mask([front_curve(:,1);back_curve(:,1)],[front_curve(:,2);back_curve(:,2)],... 45 | size(silhouette,1),size(silhouette,2)); 46 | 47 | % identify the nipple as the frontmost point 48 | nipple_y = min(front_curve(:,2)); 49 | % in case of multiple frontmost points, use the last one because we are 50 | % cutting off the higher indices 51 | nipple_id = find(front_curve(:,2)==nipple_y, 1, 'last'); 52 | nipple_x = front_curve(nipple_id,1); 53 | 54 | measurement = zeros(size(front_curve,1)-nipple_id-nipple_r, 1); 55 | for j = nipple_id+nipple_r+1:size(front_curve,1) 56 | % build a new mask directly connecting from the nipple to the candidate 57 | % cutting point 58 | maskx = poly2mask([front_curve(1:nipple_id,1);front_curve(j:end,1);back_curve(:,1)],... 59 | [front_curve(1:nipple_id,2);front_curve(j:end,2);back_curve(:,2)],... 60 | size(silhouette,1),size(silhouette,2)); 61 | % get exclusive areas between the two masks 62 | B = sum( maskx(:) & (~mask(:)) ); 63 | A = sum( mask(:) & (~maskx(:)) ); 64 | measurement(j-nipple_id-nipple_r) = B - A; 65 | 66 | % % codes that generate figure(s) for paper writting 67 | % im2write = imoverlayMathWorks(im2uint8(mask), maskx(:) & (~mask(:)), [0 1 0]); 68 | % im2write = imoverlayMathWorks(im2write, mask(:) & (~maskx(:)), [1 0 0]); 69 | % imwrite(im2write, sprintf('colorArea_%02d.png', j)); 70 | % if j == 115 71 | % figure; imshow(mat2gray(maskx)); hold on; 72 | % plot(front_curve(nipple_id+1:j-1, 1), front_curve(nipple_id+1:j-1, 2), 'r--', 'linewidth', 1.25); 73 | % hold off; 74 | % end 75 | end 76 | 77 | [measurement_sorted,ind] = sort(measurement); 78 | if any(ismember(measurement(1:3),measurement_sorted(1:3))) || all(measurement>0) 79 | % usally happens in small breasts; then use clustering 80 | disp('The breast is small and flat; its bounding plane cannot be reliably determined. Operation aborted!'); 81 | if cutoffLowEnd 82 | % restore original indices (i.e., unflipped) before returning 83 | validCol = size(silhouette, 2) - validCol(end:-1:1) + 1; 84 | end 85 | return; 86 | end 87 | 88 | validCol = transpose(front_curve(1:nipple_id+nipple_r+ind(1)-1,1)); 89 | criticalCol = validCol(end); 90 | 91 | if cutoffLowEnd % restore to unflipped indices, silhouette, etc. 92 | validCol = size(silhouette, 2) - validCol(end:-1:1) + 1; 93 | if exist('visualize','var') && visualize 94 | silhouette = fliplr(silhouette); 95 | front_curve(:, 1) = size(silhouette, 2) - front_curve(end:-1:1, 1) + 1; 96 | front_curve(:, 2) = front_curve(end:-1:1, 2); 97 | nipple_x = size(silhouette, 2) - nipple_x + 1; 98 | criticalCol = size(silhouette, 2) - criticalCol + 1; 99 | end 100 | end 101 | 102 | % update range of valid rows accordingly as it might be changed as side 103 | % effect 104 | linearInd = find(masks(:,validCol,:)); 105 | [~,~,slcSub] = ind2sub(size(masks(:,validCol,:)), linearInd); 106 | validSlc = validSlc( validSlc>=min(slcSub) & validSlc<=max(slcSub) ); 107 | 108 | if exist('visualize','var') && visualize 109 | % % codes that generate figure(s) for paper writting 110 | % figure; 111 | % imshow(silhouette); hold on; 112 | % plot(front_curve(:,1),front_curve(:,2), 'r', 'linewidth',1.5); 113 | % plot(back_curve(:,1),back_curve(:,2), 'g', 'linewidth',1.5); 114 | % plot(nipple_x,nipple_y,'go', 'markerFaceColor', 'g'); 115 | % daspect(spacing); hold off; 116 | % figure; 117 | % imshow(silhouette); hold on; 118 | % plot([criticalCol criticalCol], [1 size(slices,1)], 'g--', 'linewidth',1.25); 119 | % daspect(spacing); hold off; 120 | 121 | figure; subplot(1,2,1); 122 | % mark the critical location in axial view 123 | imshow(silhouette); hold on; 124 | plot(front_curve(:,1),front_curve(:,2), 'r'); 125 | plot(nipple_x,nipple_y,'yo'); 126 | plot([criticalCol criticalCol], [1 size(slices,1)],'g'); 127 | daspect(spacing); hold off; 128 | 129 | % display the first sagittal slice that is EXCLUDED from valid breast 130 | slices = reformatAx2Sag(slices); 131 | masks = reformatAx2Sag(masks); 132 | img2show = imoverlayMathWorks(mat2gray(slices(:,:,criticalCol)), bwperim(masks(:,:,criticalCol)), [0 1 0]); 133 | subplot(1,2,2); 134 | imshow(img2show); 135 | daspect([spacing(3) spacing(1) spacing(2)]); 136 | 137 | figure; plot(measurement); 138 | 139 | % % codes that generate figure(s) for paper writting 140 | % figure; plot(front_curve(nipple_id+nipple_r+1:end,1), measurement, 'k', 'linewidth', 1.5); hold on; 141 | % plot(front_curve(nipple_id+nipple_r+ind(1),1), min(measurement), 'r*', 'MarkerSize', 9); hold off; 142 | end 143 | 144 | end 145 | 146 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/colwiseLearn.m: -------------------------------------------------------------------------------- 1 | function [diffMap,CWL_ROI] = colwiseLearn(the_col,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 2 | %[diffMap,CWL_ROI]=COLWISELEARN(the_col,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 3 | % Detailed explanation goes here 4 | 5 | w = [0 0 0 0 0]; 6 | template = zeros(2*half_height+1,2*half_width+1); 7 | % search for a neareast neighbor in the four upright directions 8 | [nc,ns] = search_4neareastNeighbors(d_field,the_col,the_slc); 9 | for m = 1:4 10 | if ~isempty(nc{m}) && ~isempty(ns{m}) 11 | padded_slice = paddedVol(:,:,half_width+ns{m}); 12 | % extract template right here 13 | temp_temp = padded_slice( d_field(nc{m},ns{m})+(0:2*half_height), nc{m}+(0:2*half_width) ); 14 | % weighted by response strength & distance 15 | w(m) = respMap(d_field(nc{m},ns{m}),nc{m},ns{m}) / (1+abs(the_col-nc{m})+abs(the_slc-ns{m})); 16 | template = template + w(m)*temp_temp; 17 | end 18 | end 19 | padded_slice = paddedVol(:,:,half_width+the_slc); 20 | if d_field(the_col,the_slc) 21 | % if the current location has a valid depth itself, that should 22 | % be counted as well 23 | temp_temp = padded_slice( d_field(the_col,the_slc)+(0:2*half_height), the_col+(0:2*half_width) ); 24 | w(5) = respMap(d_field(the_col,the_slc),the_col,the_slc); 25 | template = template + w(5)*temp_temp; 26 | 27 | % also reduce CWL_ROI to speed up a little bit 28 | CWL_ROI = CWL_ROI & reducedROI; 29 | end 30 | if any(w) 31 | template = template/sum(w); 32 | else 33 | warning('CWL_localiseAx:colwiseLearn:noValidNeighbor', ['No valid neighbor ' ... 34 | 'found (including itself) and/or all zeros reponse: using globally adapted template.']) 35 | template = gloTemp; 36 | end 37 | % % visual display codes that generate figure for paper 38 | % if k==17 && i==44 39 | % figure('Name',num2str(i)); 40 | % imagesc(template); 41 | % colormap(gray); 42 | % axis image off 43 | % end 44 | 45 | % col-wise filtering 46 | % first extract effective rows 47 | candi = find(CWL_ROI); 48 | diffMap = ones(size(CWL_ROI)); 49 | for i = candi' 50 | jpatch = padded_slice( i+(0:2*half_height), the_col+(0:2*half_width) ); 51 | % calculate difference 52 | diffMap(i) = norm(template(:)-jpatch(:)); 53 | end 54 | 55 | end 56 | 57 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/colwiseLearn3d.m: -------------------------------------------------------------------------------- 1 | function [diffMap,CWL_ROI] = colwiseLearn3d(the_col,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 2 | %[diffMap,CWL_ROI]=COLWISELEARN(the_col,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 3 | % Detailed explanation goes here 4 | 5 | weights = [0 0 0 0 0]; 6 | template = zeros(2*half_height+1,2*half_width+1,2*half_width+1); 7 | 8 | % search for a neareast neighbor in the four upright directions 9 | [nc,ns] = search_4neareastNeighbors(d_field,the_col,the_slc); 10 | for m = 1:4 11 | if ~isempty(nc{m}) && ~isempty(ns{m}) 12 | % extract template right here 13 | temp_temp = paddedVol( d_field(nc{m},ns{m})+(0:2*half_height), nc{m}+(0:2*half_width), ns{m}+(0:2*half_width) ); 14 | % weighted by response strength & distance 15 | weights(m) = respMap(d_field(nc{m},ns{m}),nc{m},ns{m}) / (1+abs(the_col-nc{m})+abs(the_slc-ns{m})); 16 | template = template + weights(m)*temp_temp; 17 | end 18 | end 19 | 20 | % if the current location has a valid depth itself, that should be counted 21 | % as well 22 | if d_field(the_col,the_slc) 23 | temp_temp = paddedVol(d_field(the_col,the_slc)+(0:2*half_height), the_col+(0:2*half_width),the_slc+(0:2*half_width)); 24 | weights(5) = respMap(d_field(the_col,the_slc),the_col,the_slc); 25 | template = template + weights(5)*temp_temp; 26 | % also reduce CWL_ROI to speed up a little bit 27 | CWL_ROI = CWL_ROI & reducedROI; 28 | end 29 | 30 | % check existence of valid weight(s) (success of local template adaption) 31 | if any(weights) 32 | template = template/sum(weights); 33 | else 34 | warning('CWL_localiseAx:colwiseLearn:noValidNeighbor', ['No valid neighbor ' ... 35 | 'found (including itself) and/or all zeros reponse: using globally adapted template.']) 36 | template = gloTemp; 37 | end 38 | % % visual display codes that generate figure for paper 39 | % if k==17 && i==44 40 | % figure('Name',num2str(i)); 41 | % imagesc(template); 42 | % colormap(gray); 43 | % axis image off 44 | % end 45 | 46 | % col-wise filtering 47 | % first extract effective rows 48 | candi = find(CWL_ROI); 49 | diffMap = ones(size(CWL_ROI)); 50 | % iterate through each row 51 | for i = candi' 52 | ipatch = paddedVol( i+(0:2*half_height), the_col+(0:2*half_width), the_slc+(0:2*half_width) ); 53 | % calculate difference 54 | diffMap(i) = norm(template(:)-ipatch(:)); 55 | end 56 | 57 | end 58 | 59 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/cutCWL2brst.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/cutCWL2brst.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/dMap.m: -------------------------------------------------------------------------------- 1 | function d = dMap(slices,spacing,CWL_ROI,leftBounds,filter_size_half,lambdaAdjuster,iso_spacing,Tdimension,visualize) 2 | %d=DMAP(slices,spacing,CWL_ROI,leftBounds,filter_size_half,lambdaAdjuster,iso_spacing,visualize) 3 | % This function assumes inputs are only from effective slices selected by 4 | % the user 5 | 6 | [row,col,slc] = size(slices); 7 | 8 | if ~exist('iso_spacing', 'var') || isempty(iso_spacing) 9 | iso_spacing = min(spacing); 10 | end 11 | % make isotropic if necessary 12 | if any(spacing~=iso_spacing) 13 | fprintf('Interpolating for isotropic voxels ... '); 14 | [slices,CWL_ROI,leftBounds] = makeISO(slices,spacing,iso_spacing,CWL_ROI,leftBounds); 15 | disp('Done!'); 16 | end 17 | [row_iso,col_iso,slc_iso] = size(slices); 18 | 19 | % visual debug codes 20 | if exist('visualize', 'var') && visualize 21 | inspectLeftBounds(slices,leftBounds); 22 | end 23 | 24 | %% initial response and corresponding CWL 25 | % convert size of filter from physical dimension to pixels 26 | filter_size_half = round(filter_size_half/iso_spacing); 27 | if filter_size_half < 2 28 | filter_size_half = 2; % at minimum there must be 2 pixels to construct the filter 29 | end 30 | fprintf('Generically filtering ... '); 31 | if Tdimension == 3 32 | [respMap,smooth_slices] = CWL_likelihood_filtering3D(slices,CWL_ROI,leftBounds,filter_size_half,visualize); 33 | else 34 | [respMap,smooth_slices] = CWL_likelihood_filtering(slices,CWL_ROI,leftBounds,filter_size_half,visualize); 35 | end 36 | disp('Done!'); 37 | 38 | % extract CWL map from response map 39 | if exist('visualize','var') && visualize 40 | CWL_map = extractCWLmap_byMaxResp(respMap, slices); 41 | else 42 | CWL_map = extractCWLmap_byMaxResp(respMap); 43 | end 44 | 45 | % % thresh = graythresh(respMap(CWL_ROI)); 46 | % % strongMap = respMap0), 'natural'); 108 | % [yq,xq] = find(~d0); 109 | % d0(~d0) = F(xq,yq); 110 | 111 | disp('Begin depth field optimization ... '); 112 | d = dMapEnergyAx(D1, diffMap, lambdaAdjuster, visualize); 113 | 114 | % visually debug codes 115 | if exist('visualize','var') && visualize 116 | CWL_map = false(row_iso,col_iso,slc_iso); 117 | [slcSub,colSub] = meshgrid(1:slc_iso,1:col_iso); 118 | CWL_map(sub2ind([row_iso,col_iso,slc_iso],round(d(:)),colSub(:),slcSub(:)))... 119 | = true; 120 | slices_4disp = mat2gray(slices); 121 | slices_4disp(CWL_map) = 1; 122 | implay(slices_4disp); 123 | end 124 | 125 | % restore original dimensions if necessary 126 | if slc_iso~=slc || col_iso~=col 127 | [X,Y] = meshgrid( linspace(1,slc,slc_iso), linspace(1,col,col_iso) ); 128 | [Xq,Yq] = meshgrid(1:slc,1:col); 129 | d = interp2(X,Y, d, Xq,Yq, 'linear'); 130 | end 131 | if row_iso ~= row 132 | d = d*row/row_iso; 133 | end 134 | 135 | end 136 | 137 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/dMapEnergy.m: -------------------------------------------------------------------------------- 1 | function [u] = dMapEnergy(u,r,lambdaAdjuster,visualize) 2 | %[u] = dMapEnergy(u,respMap,lambdaAdjuster,visualize) 3 | % This function assumes ISOTROPIC inputs 4 | % r: some kind of filter response map, e.g., difference map 5 | % lambda: weight for smoothness term 6 | 7 | intFlag_mu = 3; 8 | 9 | % pad matrices to alliviate the boundary effect 10 | u = padarray(u, [1 1], 'replicate'); 11 | r = padarray(r, [1 0 1], 'replicate'); 12 | 13 | [row,col,slc] = size(r); 14 | 15 | [slc_sub,row_sub] = meshgrid(1:slc,1:row); 16 | 17 | dr = gradient(r); % r for response 18 | 19 | lambda = 10^lambdaAdjuster; 20 | % % Initial external and internal energy and their magnitudes 21 | % ind = sub2ind([row,col,slc],row_sub(:),round(u(:)),slc_sub(:)); 22 | % E_ext0 = sum(r(ind)); 23 | % mag_ext = log10(E_ext0); 24 | % [ux,uy]=gradient(u); 25 | % du_square_norm = ux.^2 + uy.^2; 26 | % E_int0 = sum(du_square_norm(:))/2; 27 | % mag_int = log10(E_int0); 28 | % % make the internal energy term N magnitude(s) higher than the external 29 | % % energy term in the begining 30 | % lambda = 10^ceil(lambdaAdjuster+mag_ext-mag_int); % weight for smoothing term 31 | 32 | maxIter = 10000*intFlag_mu; 33 | E_ext = zeros(1,maxIter); 34 | E_int = zeros(1,maxIter); 35 | E_seg = zeros(1,maxIter); 36 | dE = zeros(1,maxIter-1); 37 | par_der = zeros(size(u)); 38 | mu = 1; 39 | flag_converge = false; 40 | for iterCnt=1:maxIter 41 | % external energy 42 | ind = sub2ind([row,col,slc],row_sub(:),round(u(:)),slc_sub(:)); 43 | E_ext(iterCnt) = sum(r(ind)); 44 | par_der(:) = dr(ind); 45 | 46 | % internal energy 47 | u=NeumannBoundCond(u); 48 | [ux,uy]=gradient(u); 49 | du_square_norm = ux.^2 + uy.^2; 50 | E_int(iterCnt) = sum(du_square_norm(:))/2; 51 | % normDu=sqrt(ux.^2 + uy.^2 + 1e-10); 52 | % Nx=ux./normDu; 53 | % Ny=uy./normDu; 54 | % div=curvature_central(Nx,Ny); 55 | lap=4*del2(u); 56 | 57 | E_seg(iterCnt) = E_ext(iterCnt) + lambda*E_int(iterCnt); 58 | % adaptive update step mu 59 | if iterCnt>1 60 | dE(iterCnt-1)=E_int(iterCnt)-E_int(iterCnt-1); 61 | end 62 | if iterCnt>intFlag_mu 63 | divideMu = true; 64 | for j = 1:intFlag_mu 65 | if dE(iterCnt-j)<=0 66 | divideMu = false; 67 | break; 68 | end 69 | end 70 | else 71 | divideMu = false; 72 | end 73 | if divideMu 74 | fprintf('%d consecutive energy increases at Iter %d. Dividing mu...\n', ... 75 | intFlag_mu, iterCnt); 76 | mu = mu/2; 77 | end 78 | 79 | delta_u = mu*(lambda*lap-par_der); 80 | u = u + delta_u; 81 | % ad-hoc fix for out-of-bound error 82 | u(u<1) = 1; 83 | u(u>col) = col; 84 | 85 | if max(abs(delta_u(:)))<1e-3 86 | disp(['CONVERGED AT ITER ' num2str(iterCnt)]); 87 | flag_converge = true; 88 | break; 89 | end 90 | end 91 | if ~flag_converge 92 | warning('FAILED TO CONVERGE!!!'); 93 | end 94 | 95 | % visual debug codes 96 | if exist('visualize', 'var') && visualize 97 | figure; imshow(mat2gray(col-u)); 98 | figure; 99 | subplot(3,1,1); plot(E_seg(1:iterCnt)); title('E_{seg}'); 100 | subplot(3,1,2); plot(E_ext(1:iterCnt)); title('E_{ext}'); 101 | subplot(3,1,3); plot(E_int(1:iterCnt)); title('E_{int}'); 102 | end 103 | 104 | % strip the padded frame 105 | u = u(2:end-1,2:end-1); 106 | 107 | end 108 | 109 | function K = curvature_central(nx,ny) 110 | [nxx,~]=gradient(nx); 111 | [~,nyy]=gradient(ny); 112 | K=nxx+nyy; 113 | end 114 | 115 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/dMapEnergyAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/dMapEnergyAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/defineCWL_ROI_wLeftbounds.m: -------------------------------------------------------------------------------- 1 | function [CWL_ROI,leftBounds,validSlc,validRow] = defineCWL_ROI_wLeftbounds(mask_init,leftBounds,validSlc,validRow) 2 | %[CWL_ROI]=DEFINECWL_ROI_WLEFTBOUNDS(mask_init,leftBounds,validSlc,validRow) 3 | % Detailed explanation goes here 4 | 5 | % parse input 6 | if ~exist('validRow','var') 7 | [r,~] = find(any(mask_init(:,:,validSlc),3)); 8 | validRow = unique(r); 9 | end 10 | 11 | linearInd = find(mask_init); 12 | [~,colSub,~] = ind2sub(size(mask_init), linearInd); 13 | backend = round( (max(colSub)+size(mask_init,2))/2 ); 14 | 15 | CWL_ROI = false(size(mask_init)); 16 | for k = validSlc % only slices that contain breast 17 | [r,c]=find(mask_init(:,:,k)); 18 | if ~any(c>=leftBounds(k)) 19 | % The breast region is totally to the left of the left boundary of 20 | % CWL ROI. This can happen in large breasts in which 21 | % an iosolated region of breast appear in front of the body but the 22 | % undetected CWL region arealdy fades/darkens. In this case we 23 | % exclude this slice from breast region in accordance with our 24 | % clinician generated ground truth. 25 | leftBounds(k) = 0; 26 | validSlc = setxor(validSlc, k); 27 | continue 28 | end 29 | 30 | CWL_ROI(validRow,leftBounds(k):backend,k) = true; 31 | % remove air outside (to the left of) the front breast surface 32 | r=r(c>=leftBounds(k)); 33 | c=c(c>=leftBounds(k)); % now only need to consider the portion to the right of the left boundary 34 | ur = unique(r); 35 | % the first effective row in the initial mask and above 36 | frontSentinel = min(c(r==ur(1))); 37 | CWL_ROI(validRow(1):ur(1),leftBounds(k):frontSentinel-1,k) = false; 38 | % all rows in the middle 39 | for i = 2:numel(ur)-1 40 | frontSentinel = min(c(r==ur(i))); 41 | CWL_ROI(ur(i),leftBounds(k):frontSentinel-1,k) = false; 42 | end 43 | % the last effective row in the initial mask and below 44 | frontSentinel = min(c(r==ur(end))); 45 | CWL_ROI(ur(end):validRow(end),leftBounds(k):frontSentinel-1,k) = false; 46 | end 47 | 48 | % update the validRow 49 | [r,~] = find(any(mask_init(:,:,validSlc),3)); 50 | validRow = transpose(unique(r)); 51 | 52 | end 53 | 54 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/extractCWLmap_byMaxResp.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/extractCWLmap_byMaxResp.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/extractCWLmap_byMaxRespAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/extractCWLmap_byMaxRespAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/extractLeftBounds.m: -------------------------------------------------------------------------------- 1 | function [leftBounds] = extractLeftBounds(mask_body,validSlc) 2 | %[leftBounds=EXTRACTLEFTBOUNDS(mask_body,validSlc) 3 | % Detailed explanation goes here 4 | 5 | slc = size(mask_body,3); 6 | leftBounds = zeros(1,slc); 7 | 8 | silhouette = any(mask_body, 3); 9 | nip = find(any(silhouette,1),1); 10 | [r,c] = find(silhouette); 11 | butt = min( c(r==min(r)|r==max(r)) ); 12 | leftmost = round(nip+(butt-nip)/2); 13 | 14 | for k = validSlc 15 | tip = find( any(biggestCC(mask_body(:,:,k)),1), 1 ); 16 | leftBounds(k) = max(leftmost, tip); 17 | end 18 | 19 | % % uncomment codes below for paper figure generation 20 | % tipy = find(silhouette(:,nip),1); 21 | % rear = find(any(silhouette,1),1,'last'); 22 | % reary = find(silhouette(:,rear),1); 23 | % backend = round((rear+size(silhouette,2))/2); 24 | % figure; imshow(silhouette); hold on; 25 | % plot(nip,tipy, '>', 'markerfacecolor','g','markeredgecolor', 'none','markersize', 16); 26 | % plot(butt, max(r), '>', 'markerfacecolor','g','markeredgecolor','none','markersize',16); 27 | % plot(rear,reary, '<', 'markerfacecolor','g','markeredgecolor', 'none','markersize', 16); 28 | % plot([leftmost leftmost], [1 512], 'm--','linewidth',3); 29 | % plot([backend backend], [1 512], 'm--','linewidth',3); 30 | % hold off; 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/genBrstMask_from_bodyMask_n_CWLmap.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/genBrstMask_from_bodyMask_n_CWLmap.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/genBrstMask_from_bodyMask_n_CWLmapAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/genBrstMask_from_bodyMask_n_CWLmapAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/globalAdaptAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/globalAdaptAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/globalAdaptAx3d.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/globalAdaptAx3d.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/globalAdaptSag.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/globalAdaptSag.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/globalAdaptSag3d.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/globalAdaptSag3d.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/inspectFrontBounds.m: -------------------------------------------------------------------------------- 1 | function inspectFrontBounds(slices,frontBounds) 2 | %INSPECTFRONTBOUNDS(slices,frontBounds) 3 | % Detailed explanation goes here 4 | 5 | flagPtr = libpointer('uint8Ptr',0); 6 | figure('Name', 'Front bounds of CWL_ROIs', ... 7 | 'KeyPressFcn',{@showFrontbounds,slices,frontBounds,flagPtr}); 8 | imshow(mat2gray(slices(:,:,1))); 9 | title(['Slice 1/' num2str(size(slices,3))]); 10 | if frontBounds(1)>0 % skip slices that do not contain breast 11 | hold on; 12 | plot([1 size(slices,2)],[frontBounds(1) frontBounds(1)],'g'); 13 | hold off; 14 | end 15 | while ~get(flagPtr,'Value') 16 | pause(1); 17 | end 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/inspectLeftBounds.m: -------------------------------------------------------------------------------- 1 | function inspectLeftBounds(slices,leftBounds) 2 | %INSPECTLEFTBOUNDS(slices,leftBounds) 3 | % Detailed explanation goes here 4 | 5 | flagPtr = libpointer('uint8Ptr',0); 6 | figure('Name', 'Left bounds of CWL_ROIs', ... 7 | 'KeyPressFcn',{@showLeftbounds,slices,leftBounds,flagPtr}); 8 | imshow(mat2gray(slices(:,:,1))); 9 | title(['Slice 1/' num2str(size(slices,3))]); 10 | if leftBounds(1)>0 % skip slices that do not contain breast 11 | hold on; 12 | plot([leftBounds(1) leftBounds(1)],[1 size(slices,2)],'g'); 13 | hold off; 14 | end 15 | while ~get(flagPtr,'Value') 16 | pause(1); 17 | end 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/makeISO.m: -------------------------------------------------------------------------------- 1 | function [slices,CWL_ROI,leftBounds] = makeISO(slices,spacing,isoSize,CWL_ROI,leftBounds) 2 | %[slices,CWL_ROI,leftBounds]=MAKEISO(slices,spacing,isoSize,CWL_ROI,leftBounds) 3 | % Detailed explanation goes here 4 | 5 | [row,col,slc] = size(slices); 6 | 7 | row_iso = round(row*spacing(1)/isoSize); 8 | col_iso = round(col*spacing(2)/isoSize); 9 | slc_iso = round(slc*spacing(3)/isoSize); 10 | [Xq,Yq,Zq] = meshgrid(linspace(1,col,col_iso),linspace(1,row,row_iso),linspace(1,slc,slc_iso)); 11 | 12 | % interpolate slices: use 'cubic' (more prefered due to better filtering 13 | % response) or 'linear'; slices produced with 'spline' is visually inferiror 14 | slices = interp3(slices,Xq,Yq,Zq,'cubic'); 15 | CWL_ROI = interp3(double(CWL_ROI),Xq,Yq,Zq); 16 | CWL_ROI = CWL_ROI>graythresh(CWL_ROI); 17 | % modify/interpolate frontBounds accordingly 18 | if col_iso ~= col 19 | leftBounds = round( leftBounds * spacing(2)/isoSize ); 20 | end 21 | if slc_iso ~= slc 22 | leftBounds = round( interp1(1:slc, leftBounds, linspace(1,slc,slc_iso)) ); 23 | end 24 | 25 | end 26 | 27 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/makeISO_Ax.m: -------------------------------------------------------------------------------- 1 | function [slices,CWL_ROI,frontBounds] = makeISO_Ax(slices,spacing,isoSize,CWL_ROI,frontBounds) 2 | %[slices,CWL_ROI,leftBounds]=MAKEISO_AX(slices,spacing,isoSize,CWL_ROI,leftBounds) 3 | % Assuming pixel is square within image plane 4 | 5 | [row,col,slc] = size(slices); 6 | 7 | row_iso = round(row*spacing(1)/isoSize); 8 | col_iso = round(col*spacing(2)/isoSize); 9 | slc_iso = round(slc*spacing(3)/isoSize); 10 | [Xq,Yq,Zq] = meshgrid(linspace(1,col,col_iso),linspace(1,row,row_iso),linspace(1,slc,slc_iso)); 11 | 12 | % interpolate slices: use 'cubic' (more prefered due to better filtering 13 | % response) or 'linear'; slices produced with 'spline' is visually inferiror 14 | slices = interp3(slices,Xq,Yq,Zq,'cubic'); 15 | CWL_ROI = interp3(double(CWL_ROI),Xq,Yq,Zq); 16 | CWL_ROI = CWL_ROI>graythresh(CWL_ROI); 17 | % modify/interpolate frontBounds accordingly 18 | if row_iso ~= row 19 | frontBounds = round( frontBounds * spacing(1)/isoSize ); 20 | end 21 | if slc_iso ~= slc 22 | frontBounds = round( interp1(1:slc, frontBounds, linspace(1,slc,slc_iso)) ); 23 | end 24 | 25 | end 26 | 27 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/processInitMask.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/processInitMask.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/processInitMaskAx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/processInitMaskAx.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/rowwiseLearn.m: -------------------------------------------------------------------------------- 1 | function [diffMap,CWL_ROI,template] = rowwiseLearn(the_row,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 2 | %[diffMap,CWL_ROI,template]=ROWWISELEARN(the_row,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 3 | % Detailed explanation goes here 4 | 5 | % IMPORTANT NOTE: it might speed up by padding smooth_slices as a volume in 6 | % the beginning, instead of padding invidual slices inside loops below 7 | 8 | w = [0 0 0 0 0]; 9 | template = zeros(2*half_height+1,2*half_width+1); 10 | % search for a neareast neighbor in the four upright directions 11 | [nr,ns] = search_4neareastNeighbors(d_field,the_row,the_slc); 12 | for m = 1:4 13 | if ~isempty(nr{m}) && ~isempty(ns{m}) 14 | % extract template right here 15 | temp_temp = paddedVol( nr{m}+(0:2*half_height), d_field(nr{m},ns{m})+(0:2*half_width), half_height+ns{m} ); 16 | % weighted by response strength & distance 17 | w(m) = respMap(nr{m},d_field(nr{m},ns{m}),ns{m}) / (1+abs(the_row-nr{m})+abs(the_slc-ns{m})); 18 | template = template + w(m)*temp_temp; 19 | end 20 | end 21 | padded_slice = paddedVol(:,:,half_height+the_slc); 22 | if d_field(the_row,the_slc) 23 | % if the current location has a valid depth itself, that should 24 | % be counted as well 25 | temp_temp = padded_slice( the_row+(0:2*half_height), d_field(the_row,the_slc)+(0:2*half_width) ); 26 | w(5) = respMap(the_row,d_field(the_row,the_slc),the_slc); 27 | template = template + w(5)*temp_temp; 28 | 29 | % also reduce CWL_ROI to speed up a little bit 30 | CWL_ROI = CWL_ROI & reducedROI; 31 | end 32 | if any(w) 33 | template = template/sum(w); 34 | elseif ~isempty(gloTemp) 35 | warning('CWL_localise:locallyAdpat:noValidNeighbor', ['No valid neighbor ' ... 36 | 'found (including itself) and/or all zeros reponse; using globally adapted template.']) 37 | template = gloTemp; 38 | else 39 | error('CWL_localise:locallyAdpat:noValidNeighbor', 'No valid neighbor found (including itself) and/or all zeros reponse.') 40 | end 41 | 42 | % row-wise filtering 43 | % first extract effective colums 44 | candi = find(CWL_ROI); 45 | diffMap = ones(size(CWL_ROI)); 46 | for j = candi 47 | jpatch = padded_slice( the_row+(0:2*half_height), j+(0:2*half_width) ); 48 | % calculate difference 49 | diffMap(j) = norm(template(:)-jpatch(:)); 50 | end 51 | 52 | end 53 | 54 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/rowwiseLearn3d.m: -------------------------------------------------------------------------------- 1 | function [diffMap,CWL_ROI] = rowwiseLearn3d(the_row,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 2 | %[diffMap,CWL_ROI]=ROWWISELEARN3D(the_row,the_slc,d_field,half_height,half_width,paddedVol,respMap,CWL_ROI,reducedROI,gloTemp) 3 | % Detailed explanation goes here 4 | 5 | w = [0 0 0 0 0]; 6 | template = zeros(2*half_height+1,2*half_width+1,2*half_height+1); 7 | 8 | % search for a neareast neighbor in the four upright directions 9 | [nr,ns] = search_4neareastNeighbors(d_field,the_row,the_slc); 10 | for m = 1:4 11 | if ~isempty(nr{m}) && ~isempty(ns{m}) 12 | % extract template right here 13 | temp_temp = paddedVol( nr{m}+(0:2*half_height), d_field(nr{m},ns{m})+(0:2*half_width), ns{m}+(0:2*half_height) ); 14 | % weighted by response strength & distance 15 | w(m) = respMap(nr{m},d_field(nr{m},ns{m}),ns{m}) / (1+abs(the_row-nr{m})+abs(the_slc-ns{m})); 16 | template = template + w(m)*temp_temp; 17 | end 18 | end 19 | 20 | % if the current location has a valid depth itself, that should be counted 21 | % as well 22 | if d_field(the_row,the_slc) 23 | temp_temp = paddedVol( the_row+(0:2*half_height), d_field(the_row,the_slc)+(0:2*half_width), the_slc+(0:2*half_height) ); 24 | w(5) = respMap(the_row,d_field(the_row,the_slc),the_slc); 25 | template = template + w(5)*temp_temp; 26 | % also reduce CWL_ROI to speed up a little bit 27 | CWL_ROI = CWL_ROI & reducedROI; 28 | end 29 | 30 | % check existence of valid weight(s) (success of local template adaption) 31 | if any(w) 32 | template = template/sum(w); 33 | elseif ~isempty(gloTemp) 34 | warning('CWL_localise:locallyAdpat:noValidNeighbor', ['No valid neighbor ' ... 35 | 'found (including itself) and/or all zeros reponse; using globally adapted template.']) 36 | template = gloTemp; 37 | else 38 | error('CWL_localise:locallyAdpat:noValidNeighbor', 'No valid neighbor found (including itself) and/or all zeros reponse.') 39 | end 40 | % % visual display codes that generate figure for paper 41 | % if k==17 && i==44 42 | % figure('Name',num2str(i)); 43 | % imagesc(template); 44 | % colormap(gray); 45 | % axis image off 46 | % end 47 | 48 | % row-wise filtering 49 | % first extract effective colums 50 | candi = find(CWL_ROI); 51 | diffMap = ones(size(CWL_ROI)); 52 | for j = candi 53 | jpatch = paddedVol( the_row+(0:2*half_height), j+(0:2*half_width), the_slc+(0:2*half_height) ); 54 | % calculate difference 55 | diffMap(j) = norm(template(:)-jpatch(:)); 56 | end 57 | 58 | end 59 | 60 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/search_4neareastNeighbors.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/search_4neareastNeighbors.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/showFrontbounds.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/showFrontbounds.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/showLeftbounds.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/showLeftbounds.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/verticalRange_sag.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/CWL_Segmentation_3D/verticalRange_sag.m -------------------------------------------------------------------------------- /CWL_Segmentation_3D/wholeBreastSegmentAx.m: -------------------------------------------------------------------------------- 1 | function [segdata] = wholeBreastSegmentAx(dicomdir,savedir,varargin) 2 | %[segdata]=WHOLEBREASTSEGMENTAX(dicomdir,savedir,varargin) 3 | % Whole breast segmentation in axial T1w nonfat-suppressed MRI; for 4 | % detailed description of the input and output please see the help info 5 | % for function "wholeBreastSegment" 6 | 7 | visualize = false; % a debug vairable 8 | % Below: preset bottom bound plane detector; the other two options are: 9 | % (1) determineBttmBound_smlFOV: suitable for breast MRI data that covers 10 | % relatively small range in the superior/inferior direction; and 11 | % (2) determineBttmBound_bigFOV: suitable for breast MRI data that covers 12 | % relatively big range in the superior/inferior direction. 13 | % The function "determineBttmBound_allFOV" tries to adaptively choose 14 | % either one from the two, but not guaranteed to work correctly all the 15 | % time. 16 | determineBttmBound = @determineBttmBound_allFOV; 17 | 18 | % parse input 19 | p = inputParser; 20 | addParameter(p, 'ID', '', @ischar); 21 | addParameter(p, 'v', 2); 22 | addParameter(p, 'q', -1); 23 | addParameter(p, 'VoxelSize', []); % isotropic voxel size in mm 24 | addParameter(p, 'TemplateDimension', 3, @(x)(x==2)||(x==3)); 25 | addParameter(p, 'InterimOutput', false, @islogical); 26 | addParameter(p, 'LateralBounds', false, @islogical); 27 | addParameter(p, 'BottomBound', false, @islogical); 28 | addParameter(p, 'MedialBounds', false, @islogical); 29 | parse(p, varargin{:}); 30 | ID = p.Results.ID; 31 | v = p.Results.v; 32 | q = p.Results.q; 33 | VoxelSize = p.Results.VoxelSize; 34 | TemplateDimension = p.Results.TemplateDimension; 35 | InterimOutput = p.Results.InterimOutput; 36 | LateralBounds = p.Results.LateralBounds; 37 | MedialBounds = p.Results.MedialBounds; 38 | BottomBound = p.Results.BottomBound; 39 | 40 | disp('****************** Begin whole breast segmentation ******************'); 41 | 42 | % read in the MRI 43 | segdata = readmriAx(dicomdir); 44 | if ~isempty(ID) 45 | segdata.ID = ID; 46 | end 47 | 48 | % determine the isotropic voxel size according to the data if not given as 49 | % input 50 | if isempty(VoxelSize) 51 | finest = min(segdata.spacing); 52 | if finest < 1 53 | VoxelSize = .5; 54 | else 55 | VoxelSize = 1; 56 | end 57 | end 58 | 59 | disp('Air-breast separation...'); 60 | [segdata.mask_init,segdata.index,segdata.index1,segdata.index2]=airBkgSegAx... 61 | (segdata.slices,segdata.rightInd,segdata.leftInd,segdata.spacing); 62 | 63 | if LateralBounds % if requested to determine lateral bouding planes of the breasts 64 | disp('Determine breast outer bounds...'); 65 | [segdata.index,segdata.index1,segdata.index2] = determineLateralBoundAx('outer',... 66 | segdata.mask_init,segdata.slices,segdata.spacing,segdata.rightInd,segdata.leftInd,... 67 | segdata.index,segdata.index1,segdata.index2, visualize); 68 | end 69 | 70 | disp('Determine ROI for CWL localization...'); 71 | [segdata.CWL_ROI,segdata.frontBounds] = processInitMaskAx(... 72 | segdata.mask_init,segdata.index,segdata.index1,segdata.index2); 73 | 74 | if InterimOutput 75 | % save intermediate results as images for visual debug 76 | imgdir = fullfile(savedir, segdata.ID, 'CWL_ROI'); 77 | if ~exist(imgdir, 'dir') 78 | mkdir(imgdir); 79 | end 80 | slices = im2uint8(normalize01(segdata.slices)); 81 | for k = 1:size(slices,3) 82 | sliceRGB = repmat(slices(:,:,k), 1,1,3); 83 | overlaid = imoverlayMathWorks(sliceRGB, bwperim(segdata.CWL_ROI(:,:,k)), [0,1,0]); 84 | imwrite( [sliceRGB overlaid], fullfile(imgdir, [num2str(k,'%03.f') '.jpg']) ); 85 | end 86 | clear imgdir slices sliceRGB overlaid 87 | end 88 | 89 | disp('CWL localization...'); 90 | % filter_size = 2*v+1mm, lambda = 10^q 91 | [segdata.CWLs,CWL_map] = CWL_localiseAx(segdata.index,segdata.index1,segdata.index2,... 92 | segdata.slices,segdata.spacing,segdata.CWL_ROI,segdata.frontBounds,... 93 | v,q,VoxelSize,TemplateDimension); 94 | segdata.mask1 = genBrstMask_from_bodyMask_n_CWLmapAx(segdata.mask_init,... 95 | CWL_map,segdata.index1,segdata.index2); 96 | clear CWL_map 97 | 98 | if BottomBound % if requested to determine inferior bouding plane of the breasts 99 | disp('Determine breast bottom bound...'); 100 | segdata.index = determineBttmBoundAx(segdata.mask1(:,[segdata.index1 segdata.index2],:),... 101 | segdata.slices(:,[segdata.index1 segdata.index2],:),segdata.spacing,... 102 | segdata.index,determineBttmBound, visualize); 103 | % update segdata fields accordingly 104 | % clear masks and CWLs below bottom bound 105 | toClear = setdiff(1:size(segdata.mask1,3),segdata.index); 106 | segdata.mask1(:,:,toClear) = 0; 107 | for i = toClear 108 | segdata.CWLs{i} = []; 109 | end 110 | end 111 | 112 | if MedialBounds % if requested to determine medial bouding planes of the breasts 113 | disp('Determine medial bounds of breasts...'); 114 | [segdata.index,segdata.index1,segdata.index2] = determineLateralBoundAx('inner',... 115 | segdata.mask_init,segdata.slices,segdata.spacing,segdata.rightInd,segdata.leftInd,... 116 | segdata.index,segdata.index1,segdata.index2, visualize); 117 | % update segdata fields accordingly 118 | % clear masks and CWLs below bottom bound 119 | toClear = setdiff(1:size(segdata.mask1,3),segdata.index); 120 | segdata.mask1(:,:,toClear) = 0; 121 | for i = toClear 122 | segdata.CWLs{i} = []; 123 | end 124 | % clear between-breasts region in mask1 125 | toClear = setdiff(1:size(segdata.mask1,2), [segdata.index1 segdata.index2]); 126 | segdata.mask1(:,toClear,:) = 0; 127 | end 128 | 129 | disp('Quantify breast volume...') 130 | voxelVolume = prod(segdata.spacing/10); 131 | segdata.VT = voxelVolume * sum(segdata.mask1(:)>0); 132 | segdata.VT1 = voxelVolume *sum(sum(sum( segdata.mask1(:,segdata.index1,segdata.index)>0 ))); 133 | segdata.VT2 = voxelVolume *sum(sum(sum( segdata.mask1(:,segdata.index2,segdata.index)>0 ))); 134 | 135 | disp('Saving results to disk...'); 136 | % save results as images for visual debug 137 | imgdir = fullfile(savedir, segdata.ID, 'wholeBreast'); 138 | if ~exist(imgdir, 'dir') 139 | mkdir(imgdir); 140 | end 141 | slices = im2uint8(normalize01(segdata.slices)); 142 | for k = 1:size(slices,3) 143 | sliceRGB = repmat(slices(:,:,k), 1,1,3); 144 | overlaid = imoverlayMathWorks(sliceRGB, bwperim(segdata.mask1(:,:,k)>0), [0,1,0]); 145 | imwrite( [sliceRGB overlaid], fullfile(imgdir, [num2str(k,'%03.f') '.jpg']) ); 146 | end 147 | 148 | % save the segmentation structure to mat file 149 | matdir = fullfile(savedir, segdata.ID); 150 | save(fullfile(matdir, composeSavename(segdata.SeriesDescription, segdata.ID)), 'segdata', '-v7.3'); 151 | 152 | disp('****************** Whole breast segmentation done! ******************'); 153 | 154 | end 155 | 156 | -------------------------------------------------------------------------------- /CWL_Segmentation_3D/wholeBreastSegmentSag.m: -------------------------------------------------------------------------------- 1 | function [segdata] = wholeBreastSegmentSag(dicomdir,savedir,varargin) 2 | %[segdata]=WHOLEBREASTSEGMENTAX(dicomdir,savedir,varargin) 3 | % Whole breast segmentation in sagittal T1w nonfat-suppressed MRI; for 4 | % detailed description of the input and output please see the help info 5 | % for function "wholeBreastSegment" 6 | 7 | visualize = false; % a debug vairable 8 | % Below: preset bottom bound plane detector; the other two options are: 9 | % (1) determineBttmBound_smlFOV: suitable for breast MRI data that covers 10 | % relatively small range in the superior/inferior direction; and 11 | % (2) determineBttmBound_bigFOV: suitable for breast MRI data that covers 12 | % relatively big range in the superior/inferior direction. 13 | % The function "determineBttmBound_allFOV" tries to adaptively choose 14 | % either one from the two, but not guaranteed to work correctly all the 15 | % time. 16 | determineBttmBound = @determineBttmBound_allFOV; 17 | 18 | % parse input 19 | p = inputParser; 20 | addParameter(p, 'ID', '', @ischar); 21 | addParameter(p, 'v', 2); 22 | addParameter(p, 'q', -1); 23 | addParameter(p, 'VoxelSize', []); % isotropic voxel size in mm 24 | addParameter(p, 'TemplateDimension', 3, @(x)(x==2)||(x==3)); 25 | addParameter(p, 'InterimOutput', false, @islogical); 26 | addParameter(p, 'LateralBounds', true, @islogical); 27 | addParameter(p, 'BottomBound', false, @islogical); 28 | addParameter(p, 'MedialBounds', false, @islogical); 29 | parse(p, varargin{:}); 30 | ID = p.Results.ID; 31 | v = p.Results.v; 32 | q = p.Results.q; 33 | VoxelSize = p.Results.VoxelSize; 34 | TemplateDimension = p.Results.TemplateDimension; 35 | InterimOutput = p.Results.InterimOutput; 36 | LateralBounds = p.Results.LateralBounds; 37 | MedialBounds = p.Results.MedialBounds; 38 | BottomBound = p.Results.BottomBound; 39 | 40 | disp('****************** Begin whole breast segmentation ******************'); 41 | 42 | % read in the MRI 43 | segdata = readmri(dicomdir); 44 | if ~isempty(ID) 45 | segdata.ID = ID; 46 | end 47 | segdata.rightInd = segdata.index1; 48 | segdata.leftInd = segdata.index2; 49 | 50 | % determine the isotropic voxel size according to the data if not given as 51 | % input 52 | if isempty(VoxelSize) 53 | finest = min(segdata.spacing); 54 | if finest < 1 55 | VoxelSize = .5; 56 | else 57 | VoxelSize = 1; 58 | end 59 | end 60 | 61 | disp('Air-breast separation...'); 62 | disp('Processing right breast...'); 63 | [mask_init1,segdata.index1,segdata.index3] = airBkgSeg(segdata.slices(:,:,segdata.rightInd),segdata.spacing); 64 | disp('Processing left breast...'); 65 | [mask_init2,index2,segdata.index4] = airBkgSeg(segdata.slices(:,:,segdata.leftInd),segdata.spacing); 66 | segdata.index2 = index2 + max(segdata.rightInd); 67 | segdata.mask_init = cat(3, mask_init1, mask_init2); 68 | clear mask_init1 mask_init2 index2 69 | 70 | if LateralBounds % if requested to determine lateral bouding planes of the breasts 71 | disp('Determine breast lateral bounds ...'); 72 | disp('Processing right breast...'); 73 | [segdata.index1,segdata.index3] = determineLateralBound('right', 'outer',... 74 | segdata.mask_init(:,:,segdata.rightInd), segdata.slices(:,:,segdata.rightInd), ... 75 | segdata.spacing, segdata.index1, segdata.index3, visualize); 76 | disp('Processing left breast.'); 77 | [segdata.index2,segdata.index4] = determineLateralBound('left', 'outer',... 78 | segdata.mask_init(:,:,segdata.leftInd), segdata.slices(:,:,segdata.leftInd), ... 79 | segdata.spacing, segdata.index2-max(segdata.rightInd), segdata.index4, visualize); 80 | segdata.index2 = segdata.index2 + max(segdata.rightInd); 81 | end 82 | 83 | disp('Determine ROI for CWL localization...'); 84 | disp('Processing right breast...'); 85 | [CWL_ROI1,segdata.leftBounds1] = processInitMask(segdata.mask_init(:,:,segdata.rightInd),... 86 | segdata.index1,segdata.index3); 87 | disp('Processing left breast.'); 88 | [CWL_ROI2,segdata.leftBounds2] = processInitMask(segdata.mask_init(:,:,segdata.leftInd),... 89 | segdata.index2-max(segdata.rightInd),segdata.index4); 90 | segdata.CWL_ROI = cat(3, CWL_ROI1, CWL_ROI2); 91 | clear CWL_ROI1 CWL_ROI2 92 | 93 | if InterimOutput 94 | % save intermediate results as images for visual debug 95 | imgdir = fullfile(savedir, segdata.ID, 'CWL_ROI'); 96 | if ~exist(imgdir, 'dir') 97 | mkdir(imgdir); 98 | end 99 | slices = im2uint8(normalize01(segdata.slices)); 100 | for k = 1:size(slices,3) 101 | sliceRGB = repmat(slices(:,:,k), 1,1,3); 102 | overlaid = imoverlayMathWorks(sliceRGB, bwperim(segdata.CWL_ROI(:,:,k)), [0,1,0]); 103 | imwrite( [sliceRGB overlaid], fullfile(imgdir, [num2str(k,'%03.f') '.jpg']) ); 104 | end 105 | clear imgdir slices sliceRGB overlaid 106 | end 107 | 108 | disp('CWL localization...'); 109 | disp('Processing 1st (right) breast.'); 110 | [CWLs_1,CWL_map1] = CWL_localise(segdata.index1,segdata.index3,segdata.slices(:,:,segdata.rightInd),... 111 | segdata.spacing,segdata.CWL_ROI(:,:,segdata.rightInd),segdata.leftBounds1,... 112 | v,q,VoxelSize,TemplateDimension); 113 | % UPDATE CWLs with respect to the range of body mask 114 | CWLs_1 = cutCWL2brst(CWLs_1,segdata.mask_init(:,:,segdata.rightInd),segdata.index1); 115 | % Generate breast mask 116 | segdata.mask1(:,:,segdata.rightInd) = genBrstMask_from_bodyMask_n_CWLmap(... 117 | segdata.mask_init(:,:,segdata.rightInd),CWL_map1); 118 | disp('Processing 2nd (left) breast.'); 119 | segdata.index2 = segdata.index2 - segdata.rightInd(end); 120 | [CWLs_2,CWL_map2] = CWL_localise(segdata.index2,segdata.index4,segdata.slices(:,:,segdata.leftInd),... 121 | segdata.spacing,segdata.CWL_ROI(:,:,segdata.leftInd),segdata.leftBounds2,... 122 | v,q,VoxelSize,TemplateDimension); 123 | % UPDATE CWLs with respect to the range of body mask 124 | CWLs_2 = cutCWL2brst(CWLs_2,segdata.mask_init(:,:,segdata.leftInd),segdata.index2); 125 | % Generate breast mask 126 | segdata.mask1(:,:,segdata.leftInd) = genBrstMask_from_bodyMask_n_CWLmap(... 127 | segdata.mask_init(:,:,segdata.leftInd),CWL_map2); 128 | segdata.index2 = segdata.index2 + segdata.rightInd(end); 129 | % Combine results from both breasts 130 | segdata.CWLs = cat(1, CWLs_1, CWLs_2); 131 | clear CWL_map1 CWLs_1 CWL_map2 CWLs_2 132 | 133 | if BottomBound % if requested to determine inferior bouding plane of the breasts 134 | disp('Determine breast bottom bound...'); 135 | disp('Processing right breast...'); 136 | segdata.index3 = determineBttmBound(segdata.mask1(:,:,segdata.index1),... 137 | segdata.slices(:,:,segdata.index1),segdata.spacing,segdata.index3,visualize); 138 | % update segdata fields accordingly 139 | toClear = setdiff(1:size(segdata.mask1,1), segdata.index3); 140 | segdata.mask1(toClear,:,segdata.index1) = 0; 141 | segdata.CWLs(segdata.rightInd) = cutCWL2brst(segdata.CWLs(segdata.rightInd),... 142 | segdata.mask1(:,:,segdata.rightInd),segdata.index1); 143 | disp('Processing left breast...'); 144 | segdata.index4 = determineBttmBound(segdata.mask1(:,:,segdata.index2),... 145 | segdata.slices(:,:,segdata.index2),segdata.spacing,segdata.index4,visualize); 146 | % update segdata fields accordingly 147 | toClear = setdiff(1:size(segdata.mask1,1), segdata.index4); 148 | segdata.mask1(toClear,:,segdata.index2) = 0; 149 | segdata.CWLs(segdata.leftInd) = cutCWL2brst(segdata.CWLs(segdata.leftInd),... 150 | segdata.mask1(:,:,segdata.leftInd),segdata.index2-max(segdata.rightInd)); 151 | clear toClear 152 | end 153 | 154 | if MedialBounds % if requested to determine medial bouding planes of the breasts 155 | disp('Determine medial bounds of breasts'); 156 | disp('Processing right breast...'); 157 | [segdata.index1,segdata.index3] = determineLateralBound('right', 'inner',... 158 | segdata.mask1(:,:,segdata.rightInd), segdata.slices(:,:,segdata.rightInd), ... 159 | segdata.spacing, segdata.index1, segdata.index3, visualize); 160 | % update segdata fields accordingly 161 | toClear = setdiff(segdata.rightInd, segdata.index1); 162 | segdata.mask1(:,:,toClear) = 0; 163 | for j = toClear 164 | segdata.CWLs{j} = []; 165 | end 166 | toClear = setdiff(1:size(segdata.mask1,1), segdata.index3); 167 | segdata.mask1(toClear,:,segdata.index1) = 0; 168 | segdata.CWLs(segdata.rightInd) = cutCWL2brst(segdata.CWLs(segdata.rightInd),... 169 | segdata.mask1(:,:,segdata.rightInd),segdata.index1); 170 | disp('Processing left breast.'); 171 | [segdata.index2,segdata.index4] = determineLateralBound('left', 'inner',... 172 | segdata.mask1(:,:,segdata.leftInd), segdata.slices(:,:,segdata.leftInd), ... 173 | segdata.spacing, segdata.index2-max(segdata.rightInd), segdata.index4,visualize); 174 | segdata.index2 = segdata.index2 + max(segdata.rightInd); 175 | % update segdata fields accordingly 176 | toClear = setdiff(segdata.leftInd, segdata.index2); 177 | segdata.mask1(:,:,toClear) = 0; 178 | for j = toClear 179 | segdata.CWLs{j} = []; 180 | end 181 | toClear = setdiff(1:size(segdata.mask1,1), segdata.index4); 182 | segdata.mask1(toClear,:,segdata.index2) = 0; 183 | segdata.CWLs(segdata.leftInd) = cutCWL2brst(segdata.CWLs(segdata.leftInd),... 184 | segdata.mask1(:,:,segdata.leftInd),segdata.index2-max(segdata.rightInd)); 185 | clear toClear 186 | end 187 | 188 | disp('Quantify breast volume...') 189 | % per-case volume 190 | segdata.VT = calMetrics(segdata.mask1,segdata.spacing); 191 | % per-breast volume 192 | segdata.VT1 = calMetrics(segdata.mask1(:,:,segdata.index1),segdata.spacing); 193 | segdata.VT2 = calMetrics(segdata.mask1(:,:,segdata.index2),segdata.spacing); 194 | 195 | disp('Saving results to disk...'); 196 | % save results as images for visual debug 197 | imgdir = fullfile(savedir, segdata.ID, 'wholeBreast'); 198 | if ~exist(imgdir, 'dir') 199 | mkdir(imgdir); 200 | end 201 | slices = im2uint8(normalize01(segdata.slices)); 202 | for k = 1:size(slices,3) 203 | sliceRGB = repmat(slices(:,:,k), 1,1,3); 204 | overlaid = imoverlayMathWorks(sliceRGB, bwperim(segdata.mask1(:,:,k)>0), [0,1,0]); 205 | imwrite( [sliceRGB overlaid], fullfile(imgdir, [num2str(k,'%03.f') '.jpg']) ); 206 | end 207 | 208 | % save the segmentation structure to mat file 209 | matdir = fullfile(savedir, segdata.ID); 210 | save(fullfile(matdir, composeSavename(segdata.SeriesDescription, segdata.ID)), 'segdata', '-v7.3'); 211 | 212 | disp('****************** Whole breast segmentation done! ******************'); 213 | 214 | end 215 | 216 | -------------------------------------------------------------------------------- /Evaluation/calMetrics.m: -------------------------------------------------------------------------------- 1 | function [VT,FGT,VBD] = calMetrics(mask1,spacing) 2 | %[VT,FGT,VBD] = CALMETRICS(mask1,spacing) 3 | % VT: whole breast volume (cm^3) 4 | % FGT: absolute volume (cm^3) of breast dense tissue 5 | % VBD: percent breast density (%) 6 | 7 | voxel = prod(spacing/10); 8 | 9 | if any(mask1(:)) 10 | VT = sum(mask1(:)>0) * voxel; 11 | else % mask1 has not been initialilzed at all 12 | VT = 0; 13 | FGT = 0; 14 | VBD = 0; 15 | return 16 | end 17 | 18 | if any(mask1(:)==255) 19 | FGT = sum(mask1(:)==255) * voxel; 20 | VBD = FGT/VT *100; 21 | else 22 | FGT = 0; 23 | VBD = 0; 24 | end 25 | 26 | end 27 | 28 | -------------------------------------------------------------------------------- /FGT_Segmentation_3D/masked_feature_01norm.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/FGT_Segmentation_3D/masked_feature_01norm.m -------------------------------------------------------------------------------- /FGT_Segmentation_3D/scale01.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/FGT_Segmentation_3D/scale01.m -------------------------------------------------------------------------------- /MR_startup.m: -------------------------------------------------------------------------------- 1 | restoredefaultpath 2 | filePath = mfilename('fullpath'); 3 | [sourceDir,~,~] = fileparts(filePath); 4 | 5 | if (~exist(sourceDir,'dir')) 6 | error(' Error determining the paths. Exiting...'); 7 | end 8 | 9 | warning off 10 | rmpath(genpath(sourceDir)); 11 | warning on 12 | 13 | addpath(sourceDir); 14 | addpath(genpath(fullfile(sourceDir,'common'))); 15 | addpath(genpath(fullfile(sourceDir,'CWL_Segmentation_3D'))); 16 | addpath(fullfile(sourceDir,'Evaluation')); 17 | addpath(fullfile(sourceDir,'FGT_Segmentation_3D')); 18 | addpath(fullfile(sourceDir,'imageIO')); 19 | 20 | matlabVersion=version('-release'); -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # DeepSeA 2 | ### ACKNOWLEDGEMENT 3 | If you use this program in your research and/or publication(s), you must cite the paper below: 4 | 5 | - Wei, D., Weinstein, S., Hsieh, M. K., Pantalone, L., & Kontos, D. (2018). Three-Dimensional Whole Breast Segmentation in Sagittal and Axial Breast MRI With Dense Depth Field Modeling and Localized Self-Adaptation for Chest-Wall Line Detection. *IEEE Transactions on Biomedical Engineering, 66*(6), 1567-1579. 6 | 7 | ### FUNCTIONALITY 8 | This package provides functionality for 3D whole breast segmentation in breast MRI. It supports both sagittal and axial breast MRI data. Currently it requires T1w nonfat-suppressed images for segmentation. 9 | 10 | ### ENVIRONMENTS 11 | This package has been tested under: 12 | 1. Windows 7 Ultimate with Service Pack1, using MATLAB R2014b. 13 | 2. Windows 7 Enterprise with Service Pack1, using MATLAB R2014b. 14 | 3. Windows 10 Home Edition 17134.165, using MATLAB R2017a. 15 | 16 | ### USAGE 17 | To start using the package inside a Matlab environment, call 18 | 19 | ```matlab 20 | MR_startup 21 | ``` 22 | 23 | which will add all modules into MATLAB paths so that user can call the pipeline and individual functions in the Matlab workspace. 24 | 25 | ### EXAMPLES 26 | This package includes two examples with anonymized real subject data --- one for sagittal breast MRI and the other for axial breast MRI --- to illustrate basic usage. 27 | 28 | Example #1: 29 | 30 | ```matlab 31 | segdata = wholeBreastSegment('demoData\AX_T1_BILAT\', 'Results\', 'LateralBounds', true) 32 | ``` 33 | 34 | This example loads axial breast MRI data (T1w nonfat-suppressed) from DICOM files in the folder ```.\demoData\AX_T1_BILAT\```, and writes the results to the folder ```.\Results\```. In addition, it sets the optional input ```LateralBounds``` to ```true```, dictating the program to define lateral bounding planes for the breasts on the outer sides of the body. The output ```segdata``` is a struct containing various segmentation results, e.g., 3D breast masks, breast size in cm^3, etc. Please refer to the help info of the function ```wholeBreastSegment``` for detailed description. 35 | 36 | Example #2: 37 | 38 | ```matlab 39 | segdata = wholeBreastSegment('demoData\SAG_T1_3D_BILAT\', 'Results\', 'BottomBound', true) 40 | ``` 41 | This example loads sagittal breast MRI data (T1w nonfat-suppressed) from DICOM files in the folder ```.\demoData\SAG_T1_3D_BILAT\```, and writes the results to the folder ```.\Results\```. In addition, it sets the optional input ```BottomBound``` to ```true```, dictating the program to define the inferior bounding planes for the breasts. The output ```segdata``` is a struct containing various segmentation results, e.g., 3D breast masks, breast size in cm^3, etc. Please refer to the help info of the function ```wholeBreastSegment``` for detailed description. 42 | 43 | Example #2 takes much longer than Example #1 to finish due to the finer in-plane resolution of the sagittal demo data. However, you can also control the resolution used during processing by setting the ```VoxelSize``` optional input; please refer to the help info of the function ```wholeBreastSegment``` for detailed description. 44 | 45 | ### CONTACT 46 | For bug regporting, etc., please email: 47 | weidong111624@gmail.com / Dong.Wei@uphs.upenn.edu / Meng-Kang.Hsieh@uphs.upenn.edu 48 | -------------------------------------------------------------------------------- /common/CCFilterKeepLargestN.m: -------------------------------------------------------------------------------- 1 | function [cleanmask] = CCFilterKeepLargestN(initmask, N) 2 | % [cleanmask] = CCFilterKeepLargestN(initmask, N) 3 | % Keeps only largest N connected components 4 | 5 | CC = bwconncomp(initmask); 6 | numPixels = cellfun(@numel, CC.PixelIdxList); 7 | 8 | % keep only the N largest components 9 | [~, idx] = sort(numPixels, 'descend'); 10 | cleanmask = false(size(initmask)); 11 | if numel(idx) <= N 12 | cleanmask = initmask; 13 | else 14 | for i = 1:N 15 | cleanmask(CC.PixelIdxList{idx(i)}) = 1; 16 | end 17 | end 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /common/CCFilterRemoveSmallOnes.m: -------------------------------------------------------------------------------- 1 | function [cleanmask] = CCFilterRemoveSmallOnes(initmask, N) 2 | % [cleanmask] = CCFilterRemoveSmallOnes(initmask, N) 3 | % connected component number analysis 4 | 5 | CC = bwconncomp(initmask); 6 | numPixels = cellfun(@numel, CC.PixelIdxList); 7 | 8 | idx = find(numPixels<=N); 9 | cleanmask = initmask; 10 | for i = 1:length(idx) 11 | cleanmask(CC.PixelIdxList{idx(i)}) = 0; 12 | end 13 | 14 | end 15 | 16 | -------------------------------------------------------------------------------- /common/NeumannBoundCond.m: -------------------------------------------------------------------------------- 1 | function [ g ] = NeumannBoundCond( f ) 2 | %g = NEUMANNBOUNDCOND(f) 3 | % Make a function satisfy Neumann boundary condition 4 | 5 | [nrow,ncol] = size(f); 6 | g = f; 7 | g([1 nrow],[1 ncol]) = g([3 nrow-2],[3 ncol-2]); 8 | g([1 nrow],2:end-1) = g([3 nrow-2],2:end-1); 9 | g(2:end-1,[1 ncol]) = g(2:end-1,[3 ncol-2]); 10 | 11 | end 12 | 13 | -------------------------------------------------------------------------------- /common/biggestCC.m: -------------------------------------------------------------------------------- 1 | function [BW] = biggestCC(BW) 2 | %[BW] = BIGGESTCC(BW) 3 | % Keep only the biggest connected component in a binary image (2D or 3D) 4 | 5 | CC = bwconncomp(BW); 6 | numPixels = cellfun(@numel,CC.PixelIdxList); 7 | [~,idx] = max(numPixels); 8 | BW(:) = false; 9 | BW(CC.PixelIdxList{idx}) = 1; 10 | 11 | end 12 | 13 | -------------------------------------------------------------------------------- /common/composeSavename.m: -------------------------------------------------------------------------------- 1 | function [savename] = composeSavename(seriesDescription,pid) 2 | %[savename]=COMPOSESAVENAME(seriesDescription,pid) 3 | % Detailed explanation goes here 4 | 5 | seriesDescription(~isstrprop(seriesDescription, 'alphanum')) = '_'; 6 | savename = sprintf('%s_%s', pid, seriesDescription); 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /common/imoverlayMathWorks.m: -------------------------------------------------------------------------------- 1 | function out = imoverlayMathWorks(in, mask, color) 2 | %IMOVERLAY Create a mask-based image overlay. 3 | % OUT = IMOVERLAY(IN, MASK, COLOR) takes an input image, IN, and a binary 4 | % image, MASK, and produces an output image whose pixels in the MASK 5 | % locations have the specified COLOR. 6 | % 7 | % IN should be a grayscale or an RGB image of class uint8, uint16, int16, 8 | % logical, double, or single. If IN is double or single, it should be in 9 | % the range [0, 1]. If it is not in that range, you might want to use 10 | % mat2gray to scale it into that range. 11 | % 12 | % MASK should be a two-dimensional logical matrix. 13 | % 14 | % COLOR should be a 1-by-3 vector of values in the range [0, 1]. [0 0 0] 15 | % is black, and [1 1 1] is white. 16 | % 17 | % OUT is a uint8 RGB image. 18 | % 19 | % Examples 20 | % -------- 21 | % Overlay edge detection result in green over the original image. 22 | % 23 | % I = imread('cameraman.tif'); 24 | % bw = edge(I, 'canny'); 25 | % rgb = imoverlay(I, bw, [0 1 0]); 26 | % imshow(rgb) 27 | % 28 | % Treating the output of peaks as an image, overlay the values greater than 29 | % 7 in red. The output of peaks is not in the usual grayscale image range 30 | % of [0, 1], so use mat2gray to scale it. 31 | % 32 | % I = peaks; 33 | % mask = I > 7; 34 | % rgb = imoverlay(mat2gray(I), mask, [1 0 0]); 35 | % imshow(rgb, 'InitialMagnification', 'fit') 36 | 37 | % Steven L. Eddins, The MathWorks, Inc. 38 | % $Revision: 1.2 $ $Date: 2007/08/15 13:18:08 $ 39 | 40 | % If the user doesn't specify the color, use white. 41 | DEFAULT_COLOR = [1 1 1]; 42 | if nargin < 3 43 | color = DEFAULT_COLOR; 44 | end 45 | 46 | % Make the uint8 the working data class. The output is also uint8. 47 | in_uint8 = im2uint8(in); 48 | color_uint8 = im2uint8(color); 49 | 50 | % Initialize the red, green, and blue output channels. 51 | if ndims(in_uint8) == 2 52 | % Input is grayscale. Initialize all output channels the same. 53 | out_red = in_uint8; 54 | out_green = in_uint8; 55 | out_blue = in_uint8; 56 | else 57 | % Input is RGB truecolor. 58 | out_red = in_uint8(:,:,1); 59 | out_green = in_uint8(:,:,2); 60 | out_blue = in_uint8(:,:,3); 61 | end 62 | 63 | % Replace output channel values in the mask locations with the appropriate 64 | % color value. 65 | out_red(mask) = color_uint8(1); 66 | out_green(mask) = color_uint8(2); 67 | out_blue(mask) = color_uint8(3); 68 | 69 | % Form an RGB truecolor image by concatenating the channel matrices along 70 | % the third dimension. 71 | out = cat(3, out_red, out_green, out_blue); 72 | -------------------------------------------------------------------------------- /common/kmeanspp.m: -------------------------------------------------------------------------------- 1 | function [L,C] = kmeanspp(X,k) 2 | %KMEANS Cluster multivariate data using the k-means++ algorithm. 3 | % [L,C] = kmeans(X,k) produces a 1-by-size(X,2) vector L with one class 4 | % label per column in X and a size(X,1)-by-k matrix C containing the 5 | % centers corresponding to each class. 6 | 7 | % Version: 2013-02-08 8 | % Authors: Laurent Sorber (Laurent.Sorber@cs.kuleuven.be) 9 | % 10 | % References: 11 | % [1] J. B. MacQueen, "Some Methods for Classification and Analysis of 12 | % MultiVariate Observations", in Proc. of the fifth Berkeley 13 | % Symposium on Mathematical Statistics and Probability, L. M. L. Cam 14 | % and J. Neyman, eds., vol. 1, UC Press, 1967, pp. 281-297. 15 | % [2] D. Arthur and S. Vassilvitskii, "k-means++: The Advantages of 16 | % Careful Seeding", Technical Report 2006-13, Stanford InfoLab, 2006. 17 | 18 | L = []; 19 | L1 = 0; 20 | 21 | while length(unique(L)) ~= k 22 | 23 | % The k-means++ initialization. 24 | C = X(:,1+round(rand*(size(X,2)-1))); 25 | L = ones(1,size(X,2)); 26 | for i = 2:k 27 | D = X-C(:,L); 28 | D = cumsum(sqrt(dot(D,D,1))); 29 | if D(end) == 0, C(:,i:k) = X(:,ones(1,k-i+1)); return; end 30 | C(:,i) = X(:,find(rand < D/D(end),1)); 31 | [~,L] = max(bsxfun(@minus,2*real(C'*X),dot(C,C,1).')); 32 | end 33 | 34 | % The k-means algorithm. 35 | while any(L ~= L1) 36 | L1 = L; 37 | for i = 1:k, l = L==i; C(:,i) = sum(X(:,l),2)/sum(l); end 38 | [~,L] = max(bsxfun(@minus,2*real(C'*X),dot(C,C,1).'),[],1); 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /common/levelset/normalize01.m: -------------------------------------------------------------------------------- 1 | function f=normalize01(f) 2 | % Normalize to the range of [0,1] 3 | 4 | f = double(f); 5 | fmin = min(f(:)); 6 | fmax = max(f(:)); 7 | f = (f-fmin)/(fmax-fmin); % Normalize f to the range [0,1] -------------------------------------------------------------------------------- /common/reformatAx2Sag.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/common/reformatAx2Sag.m -------------------------------------------------------------------------------- /common/reformatSag2Ax.m: -------------------------------------------------------------------------------- 1 | function [ax] = reformatSag2Ax(sag) 2 | %[ax]=REFORMATSAG2AX(sag) 3 | % Detailed explanation goes here 4 | 5 | sag = flipud(sag); % head/feet flip 6 | 7 | [slc,row,col] = size(sag); 8 | if islogical(sag) 9 | ax = false(row,col,slc); 10 | else 11 | ax = zeros(row,col,slc, 'like', sag); 12 | end 13 | 14 | for k = 1:slc 15 | for j = 1:col 16 | ax(:,j,k) = sag(k,:,j); 17 | end 18 | end 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00001.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00001.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00002.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00002.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00003.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00003.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00004.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00004.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00005.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00005.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00006.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00006.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00007.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00007.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00008.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00008.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00009.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00009.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00010.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00010.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00011.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00011.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00012.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00012.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00013.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00013.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00014.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00014.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00015.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00015.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00016.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00016.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00017.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00017.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00018.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00018.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00019.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00019.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00020.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00020.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00021.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00021.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00022.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00022.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00023.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00023.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00024.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00024.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00025.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00025.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00026.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00026.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00027.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00027.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00028.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00028.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00029.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00029.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00030.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00030.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00031.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00031.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00032.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00032.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00033.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00033.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00034.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00034.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00035.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00035.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00036.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00036.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00037.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00037.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00038.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00038.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00039.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00039.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00040.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00040.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00041.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00041.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00042.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00042.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00043.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00043.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00044.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00044.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00045.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00045.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00046.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00046.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00047.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00047.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00048.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00048.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00049.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00049.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00050.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00050.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00051.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00051.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00052.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00052.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00053.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00053.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00054.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00054.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00055.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00055.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00056.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00056.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00057.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00057.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00058.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00058.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00059.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00059.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00060.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00060.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00061.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00061.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00062.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00062.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00063.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00063.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00064.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00064.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00065.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00065.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00066.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00066.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00067.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00067.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00068.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00068.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00069.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00069.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00070.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00070.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00071.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00071.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00072.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00072.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00073.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00073.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00074.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00074.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00075.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00075.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00076.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00076.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00077.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00077.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00078.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00078.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00079.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00079.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00080.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00080.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00081.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00081.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00082.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00082.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00083.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00083.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00084.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00084.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00085.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00085.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00086.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00086.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00087.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00087.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00088.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00088.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00089.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00089.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00090.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00090.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00091.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00091.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00092.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00092.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00093.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00093.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00094.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00094.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00095.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00095.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00096.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00096.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00097.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00097.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00098.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00098.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00099.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00099.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00100.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00100.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00101.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00101.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00102.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00102.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00103.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00103.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00104.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00104.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00105.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00105.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00106.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00106.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00107.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00107.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00108.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00108.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00109.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00109.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00110.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00110.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00111.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00111.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00112.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00112.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00113.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00113.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00114.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00114.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00115.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00115.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00116.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00116.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00117.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00117.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00118.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00118.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00119.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00119.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00120.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00120.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00121.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00121.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00122.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00122.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00123.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00123.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00124.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00124.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00125.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00125.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00126.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00126.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00127.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00127.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00128.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00128.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00129.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00129.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00130.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00130.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00131.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00131.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00132.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00132.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00133.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00133.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00134.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00134.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00135.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00135.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00136.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00136.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00137.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00137.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00138.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00138.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00139.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00139.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00140.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00140.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00141.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00141.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00142.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00142.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00143.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00143.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00144.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00144.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00145.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00145.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00146.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00146.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00147.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00147.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00148.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00148.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00149.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00149.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00150.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00150.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00151.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00151.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00152.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00152.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00153.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00153.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00154.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00154.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00155.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00155.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00156.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00156.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00157.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00157.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00158.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00158.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00159.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00159.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00160.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00160.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00161.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00161.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00162.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00162.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00163.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00163.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00164.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00164.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00165.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00165.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00166.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00166.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00167.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00167.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00168.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00168.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00169.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00169.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00170.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00170.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00171.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00171.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00172.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00172.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00173.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00173.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00174.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00174.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00175.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00175.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00176.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00176.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00177.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00177.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00178.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00178.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00179.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00179.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00180.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00180.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00181.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00181.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00182.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00182.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00183.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00183.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00184.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00184.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00185.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00185.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00186.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00186.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00187.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00187.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00188.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00188.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00189.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00189.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00190.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00190.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00191.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00191.dcm -------------------------------------------------------------------------------- /demoData/AX_T1_BILAT/ser003img00192.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/AX_T1_BILAT/ser003img00192.dcm -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000665684776801: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000665684776801 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000666605876804: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000666605876804 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000673337476807: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000673337476807 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000678074076808: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000678074076808 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000681911276813: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000681911276813 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000687738476814: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000687738476814 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000696320676815: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000696320676815 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000696646376816: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000696646376816 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000816612076828: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000816612076828 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000821667976829: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000821667976829 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000821899476830: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000821899476830 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000827367276833: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000827367276833 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000828754076834: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000828754076834 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000834022476835: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000834022476835 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000845968776840: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000845968776840 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000855482876841: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000855482876841 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000910058876850: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000910058876850 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000912043776853: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000912043776853 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000913386176854: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000913386176854 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000914159376857: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000914159376857 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000916167876858: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000916167876858 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000919196676861: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000919196676861 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000923195976862: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000923195976862 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000931305476865: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000931305476865 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000983546776874: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000983546776874 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000983922976875: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000983922976875 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000985431776878: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000985431776878 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000987345776881: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000987345776881 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000990612476884: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000990612476884 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000991259076885: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000991259076885 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000994970776886: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312000994970776886 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131200103625276889: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131200103625276889 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001055178676896: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001055178676896 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001056162576899: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001056162576899 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001056987276904: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001056987276904 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001061238876907: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001061238876907 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001062472076908: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001062472076908 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001062592576909: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001062592576909 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001066772976910: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001066772976910 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001076233276913: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001076233276913 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001121259676922: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001121259676922 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001121467276923: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001121467276923 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001124051576924: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001124051576924 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001125365376925: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312001125365376925 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010219709377016: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010219709377016 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010235110577025: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010235110577025 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010237757777026: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010237757777026 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010239735277029: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010239735277029 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010244234677030: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010244234677030 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010252138577033: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010252138577033 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010259301777036: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010259301777036 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010265642777037: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010265642777037 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010371636977045: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010371636977045 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010374457177050: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010374457177050 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010382586477051: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010382586477051 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010384519377052: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010384519377052 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010386822477055: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010386822477055 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010395340077056: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010395340077056 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010418668477062: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010418668477062 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010464978477069: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010464978477069 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010467621477072: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010467621477072 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010470340277073: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010470340277073 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010471420677074: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010471420677074 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201047630777061: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201047630777061 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010477427777077: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010477427777077 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010485097477084: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010485097477084 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010485684877085: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010485684877085 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010487125577086: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010487125577086 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010534493677095: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010534493677095 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010537327577096: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010537327577096 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010537942577097: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010537942577097 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010539598277100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010539598277100 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010545486577101: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010545486577101 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010556622477108: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010556622477108 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010558502377109: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010558502377109 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010559702077110: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010559702077110 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010611088077124: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010611088077124 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010614584877125: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010614584877125 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010631540777130: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010631540777130 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201063325677117: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201063325677117 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010635299577133: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010635299577133 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010638947077134: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010638947077134 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201064023877118: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201064023877118 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201064615977119: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.201411131201064615977119 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010668083677141: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010668083677141 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010669198277142: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010669198277142 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010670011877145: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010670011877145 -------------------------------------------------------------------------------- /demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010674871877146: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CBICA/DeepSeA/da4e31e0c4080e650c49e016b4adae75a59016cc/demoData/SAG_T1_3D_BILAT/MR.1.3.12.2.1107.5.2.31.30667.2014111312010674871877146 -------------------------------------------------------------------------------- /imageIO/readmri.m: -------------------------------------------------------------------------------- 1 | function mriout = readmri( dicomdir, varargin) 2 | % Read the MRI data found in dicomdir. 3 | % SINTAX: 4 | % mri = readmri(dicomdir) 5 | % mri = readmri(dicomdir, 'protocol', 'T1 3D'); 6 | % mri = readmri(dicomdir, 'read_all', true) 7 | % 8 | % INPUT: 9 | % Required 10 | % dicomdir path to the dicom directory 11 | % Optional 12 | % protocol keyword to choose the MR protocol of interest 13 | % Default: 'all' for all protocol 14 | % read_all a flag to read in all dicoms in a given path 15 | % Default: true 16 | % OUTPUT: 17 | % mri data structure in the same standard format as described in 18 | % the 'Readme.txt'; specifically, the field 'index1' is a vector of 19 | % indecies for right-breast slices, and 'index2' left-breast 20 | % 21 | % EXAMPLE: 22 | % >> mri = readmri('.\samples\mri'); 23 | % >> slideshow(mri.serie{1}); 24 | % 25 | % 26 | % $Rev: 1633 $: Revision of last commit 27 | % $Author: hsiehm@UPHS.PENNHEALTH.PRV $: Author of last commit 28 | % $Date: 2018-08-23 10:49:57 -0400 (Thu, 23 Aug 2018) $: Date of last commit 29 | 30 | parseInput 31 | 32 | file_list = imlist(dicomdir); 33 | N = length(file_list); 34 | SN = zeros(N, 1); 35 | IN = zeros(N, 1); 36 | SL = zeros(N, 1); 37 | fprintf('Retrieving info: ') 38 | PN = cell(N, 1); 39 | 40 | for n = 1:N 41 | try 42 | info = dicominfo(file_list{n}); 43 | catch err 44 | if strcmp(err.message,'The specified file is not in DICOM format.') 45 | fprintf('\b\b\b\b\b[%02.0d%%]',floor(100 * n / N)) 46 | continue 47 | else 48 | error(err.message); 49 | end 50 | end 51 | if isfield(info, 'SeriesDescription'); PN{n} = info.SeriesDescription;end 52 | if isfield(info, 'SeriesNumber'); SN(n) = info.SeriesNumber;end 53 | if isfield(info, 'InstanceNumber'); IN(n) = info.InstanceNumber;end 54 | if isfield(info, 'SliceLocation'); SL(n) = info.SliceLocation;end 55 | % if InversionTime ~= info.InversionTime % added by D.Wei on 2016/2/24 56 | % error('Inverstion time of the designated data is unexpected!') 57 | % end 58 | fprintf('\b\b\b\b\b[%02.0d%%]',floor(100 * n / N)) 59 | end 60 | 61 | % Validating the sequence information 62 | SN = SN(SN~=0); 63 | IN = IN(IN~=0); 64 | PN = PN(~cellfun(@isempty, PN)); 65 | 66 | % SNu: Unique Series numbers 67 | [SNu,idx] = unique(SN); 68 | PNu = PN(idx); 69 | S = numel(SNu); 70 | fprintf('\n%d files, %d protocols\n', N, S); 71 | fprintf('Retrieving images: ') 72 | series = repmat(struct('images', [], 'SeriesDescription', []), [S, 1]); 73 | No_images = 0; 74 | remov = false(S, 1); 75 | 76 | % S: number of unique series (number) 77 | for s = 1:S 78 | SN_ref = SNu(s); 79 | NI_sel = unique(IN(SN == SN_ref)); 80 | series(s).images = cell(numel(NI_sel), 1); 81 | N = length(NI_sel); 82 | if strcmp(PNu(s), 'localizer') 83 | remov(s) = true; 84 | continue 85 | end 86 | % N: number of images in series s. Also sort by instance number 87 | for n = 1:N 88 | idx = find( (SN == SN_ref) & (IN == NI_sel(n))); 89 | if numel(idx) > 1; 90 | error(['More than one slice at instance ', num2str(n)]); 91 | elseif numel(idx) < 1; 92 | error(['Unable to find any slice at instance ', num2str(n)]); 93 | end 94 | series(s).SeriesDescription = PN{idx}; 95 | series(s).images{n} = file_list{idx}; 96 | series(s).slicelocation(n) = SL(idx); 97 | end 98 | No_images = No_images + N; 99 | fprintf('\b\b\b\b\b[%02.0d%%]',floor(100 * s / S)) 100 | end 101 | 102 | series(remov) = []; 103 | pflag = (nargin<2); 104 | if ~pflag&&~any(strcmpi(protocol,'all')) 105 | %Remove images that do not match chosen protocol 106 | P = length(series); 107 | remov = false(1, P); 108 | No_images = 0; 109 | for p = 1:P 110 | remov(p) = ~any(strcmpi(protocol, series(p).SeriesDescription)); 111 | if ~remov(p), No_images = No_images + length(series(p).images); 112 | end 113 | end 114 | series(remov) = []; 115 | fprintf('\n%d images.\n', No_images) 116 | elseif length(series) == 1; 117 | fprintf('\n') 118 | else 119 | %Request user input for a protocol 120 | fprintf('\n%d images.\n', No_images) 121 | fprintf('\nLIST OF PROTOCOLS:\n') 122 | P = length(series); 123 | for p = 1:P 124 | fprintf('%d) %s \n', p, series(p).SeriesDescription) 125 | end 126 | i = input('Please select protocol: '); 127 | p = 1:P; 128 | series(p~=i) = []; 129 | end 130 | 131 | info = dicominfo(series(1).images{1}); 132 | 133 | mriout = repmat(struct('ID', [], 'spacing', [], 'slices', [], ... 134 | 'mask1',[], 'mask2', [], 'VBD', [], 'FGT',[],'BPE', [],'VT', [],... 135 | 'SeriesDescription', [], 'index1', [], 'index2', [], 'BitDepth', []),size(series)); 136 | % 'BitDepth' field added by D.Wei on 2016/2/18 as needed in bias-field correction 137 | 138 | for n = 1:length(series) 139 | 140 | %%% Pre and posts dicom images from GE are usually assigned with the same 141 | %%% series number and description hence are organized into one directory by 142 | %%% sortDicom.m. As we most of the time need just the pre image to be 143 | %%% loaded, a GE private tag (0025,1007) and (0025,1011) are used to determine 144 | %%% the length of the pre series from the first dicom. In other cases, full 145 | %%% length of the series found in a given directory will be used. 146 | if ~read_all && isfield(info, 'Private_0025_1007') && isfield(info, 'Private_0025_1011'); 147 | hex = flipud(dec2hex(info.Private_0025_1007)); 148 | hex_real = [hex(1,:) hex(2,:) hex(3,:) hex(4,:)]; 149 | numImgInSeries = hex2dec(hex_real); 150 | hex = flipud(dec2hex(info.Private_0025_1011)); 151 | hex_real = [hex(1,:) hex(2,:)]; 152 | numAcqInSeries = hex2dec(hex_real); 153 | fprintf('(0025, 1007) Images in Series: %d\n', numImgInSeries); 154 | fprintf('(0025, 1011) Number of Acquisition: %d\n', numAcqInSeries); 155 | if numImgInSeries == length(series(n).images); 156 | numImgInSeries = numImgInSeries/numAcqInSeries; 157 | elseif numImgInSeries < length(series(n).images); 158 | if ~(length(series(n).images)/numImgInSeries == numAcqInSeries); 159 | numAcqInSeries = length(series(n).images)/numImgInSeries; 160 | if ~(floor(numAcqInSeries) == ceil(numAcqInSeries)); 161 | error(['Non-sense value for Number of Acquisition: ' numAcqInSeries]); 162 | end 163 | numImgInSeries = length(series(n).images)/numAcqInSeries; 164 | else 165 | numImgInSeries = numImgInSeries/numAcqInSeries; 166 | end 167 | elseif numImgInSeries > length(series(n).images); 168 | warning('Not enough images found for this series in the directory.'); 169 | numImgInSeries = length(series(n).images); 170 | end 171 | else 172 | numImgInSeries = length(series(n).images); 173 | end 174 | 175 | mriout(n).ID = info.AccessionNumber; 176 | fprintf('Loading images: ') 177 | for p = 1:numImgInSeries 178 | mriout(n).slices(:,:,p) = dicomread(series(n).images{p}); 179 | fprintf('\b\b\b\b\b[%02.0d%%]', floor(100 * p / numImgInSeries)) 180 | if series(n).slicelocation(1)*series(n).slicelocation(p) > 0; 181 | mriout(n).index1 = [ mriout(n).index1, p ]; % SL < 0 is right breast 182 | else 183 | mriout(n).index2 = [ mriout(n).index2, p ]; % SL > 0 is left breast 184 | end 185 | end 186 | fprintf('\n') 187 | mriout(n).SeriesDescription = series(n).SeriesDescription; 188 | mriout(n).spacing = [info.PixelSpacing(:); info.SliceThickness]; 189 | mriout(n).BitDepth = info.BitDepth; % 'BitDepth' field added by D.Wei on 2016/2/18 as needed in bias-field correction 190 | end 191 | fprintf('Ok\n') 192 | 193 | function parseInput 194 | parser=inputParser; 195 | addRequired(parser, 'dicomdir', @isdir); 196 | addParameter(parser, 'protocol', 'all', @ischar); 197 | addParameter(parser, 'read_all', false, @islogical); 198 | addParameter(parser, 'InversionTime', 1600, @isnumeric); 199 | 200 | parse(parser, dicomdir, varargin{:}); 201 | 202 | dicomdir = parser.Results.dicomdir; 203 | protocol = parser.Results.protocol; 204 | read_all = parser.Results.read_all; 205 | InversionTime = parser.Results.InversionTime; 206 | 207 | end % end of parseInput 208 | 209 | end % end of readmri 210 | 211 | function [image_path] = imlist(folder_path, ext) 212 | % Retrieve list of dicom images in a folder 213 | % SINTAX: 214 | % image_path = imlist(folder_path) 215 | % image_path = imlist(folder_path, ext) 216 | % DESCRIPTION: 217 | % Retrieve list of DICOM images in the folder found at 218 | % folder_path. The output, image_path, is a string (or a cell 219 | % array of strings) the full path of the images(s) in that 220 | % folder. 221 | % 222 | % Said Pertuz 223 | % Nov06/2013 224 | 225 | image_path = []; 226 | 227 | if ~exist(folder_path, 'dir') 228 | warning('Sorry, I cant find the speficied directory') 229 | return 230 | end 231 | 232 | if nargin==2 233 | flist = dir([folder_path,filesep,'*.',ext]); 234 | flist([flist.isdir]==1) = []; 235 | if isempty(flist) 236 | warning('Sorry, no *.%s files in the speficied directory',ext) 237 | return 238 | end 239 | elseif nargin==1 240 | flist = dir(folder_path); 241 | flist([flist.isdir]==1) = []; 242 | end 243 | 244 | N = length(flist); 245 | if N>1, image_path = cell(N, 1); 246 | else image_path = flist.name; return 247 | end 248 | 249 | for n = 1:N 250 | image_path{n} = [folder_path,filesep,flist(n).name]; 251 | end 252 | end 253 | 254 | 255 | -------------------------------------------------------------------------------- /imageIO/readmriAx.m: -------------------------------------------------------------------------------- 1 | function [mriout] = readmriAx(dicomdir, assignedID) 2 | %READMRIAX Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | dicomlist = dir(fullfile(dicomdir, '*.dcm')); 6 | if isempty(dicomlist) 7 | dicomlist = dir(dicomdir); 8 | dicomlist = dicomlist(3:end); 9 | end 10 | num_dicom = numel(dicomlist); 11 | 12 | fprintf('All %d slices, sorting the %03d', num_dicom, 1); 13 | 14 | dicomfile = dicomlist(1).name; 15 | dicomheader = dicominfo(fullfile(dicomdir, dicomfile)); 16 | sliceLocations = zeros(num_dicom,1); 17 | sliceLocations(1) = dicomheader.SliceLocation; 18 | 19 | for i = 2:num_dicom 20 | fprintf('\b\b\b%03d', num_dicom, i); 21 | 22 | dicomfile = dicomlist(i).name; 23 | info = dicominfo(fullfile(dicomdir, dicomfile)); 24 | 25 | % check for data consistency below 26 | if ~strcmpi(dicomheader.StudyID, info.StudyID) 27 | error('Dicom files are inconsistent.') 28 | end 29 | if ~isequal(dicomheader.PixelSpacing, info.PixelSpacing) 30 | error('Dicom files are inconsistent.') 31 | end 32 | if dicomheader.SliceThickness ~= info.SliceThickness 33 | error('Dicom files are inconsistent.') 34 | end 35 | if ~isequal(dicomheader.ImageOrientationPatient, info.ImageOrientationPatient) 36 | error('Dicom files are inconsistent.') 37 | end 38 | if ~isequal(dicomheader.ImagePositionPatient(1:2), info.ImagePositionPatient(1:2)) 39 | error('Dicom files are inconsistent: ImagePositionPatient.') 40 | end 41 | if ~strcmpi(dicomheader.SeriesDescription, info.SeriesDescription) 42 | error('Dicom files are inconsistent.') 43 | end 44 | if dicomheader.BitDepth ~= info.BitDepth 45 | error('Dicom files are inconsistent.') 46 | end 47 | 48 | sliceLocations(i) = info.SliceLocation; 49 | end 50 | fprintf('\n'); 51 | 52 | if exist('assignedID', 'var') 53 | studyID = assignedID; 54 | else 55 | studyID = dicomheader.StudyID; 56 | end 57 | 58 | % sort according to SliceLocation 59 | [sliceLocations, I] = sort(sliceLocations, 'ascend'); 60 | % check consistency between SliceLocationa and SliceThickness 61 | realthickness = unique(round(diff(sliceLocations),2)); 62 | if numel(realthickness)>1 63 | error('Inconsistent SliceLocation and/or SliceThickness, or missing slice(s).'); 64 | end 65 | if abs(realthickness) ~= round(dicomheader.SliceThickness,2) 66 | error('Inconsistency between SliceLocation and SliceThickness'); 67 | end 68 | % allocate memeory for images 69 | slices = zeros(dicomheader.Rows, dicomheader.Columns,num_dicom); 70 | fprintf('All %d slices, reading the %03d', num_dicom, 1); 71 | % read images 72 | for i = 1:num_dicom 73 | fprintf('\b\b\b%03d', num_dicom, i); 74 | dicomfile = dicomlist(I(i)).name; 75 | imgdata = dicomread(fullfile(dicomdir, dicomfile)); 76 | if isempty(imgdata) 77 | error('DICOM file %s is empty!', dicomfile); 78 | else 79 | slices(:,:,i) = imgdata; 80 | end 81 | end 82 | % in case of left-right reversed image 83 | if dicomheader.ImageOrientationPatient(1)<0 84 | slices = flip(slices, 2); 85 | IPP1 = -dicomheader.ImagePositionPatient(1); 86 | else 87 | IPP1 = dicomheader.ImagePositionPatient(1); 88 | end 89 | % in case of upside down image 90 | if dicomheader.ImageOrientationPatient(5)<0 91 | slices = flip(slices, 1); 92 | end 93 | fprintf('\n'); 94 | 95 | % will be used to determine right/left breasts 96 | lrIndicator = double(0:dicomheader.Columns-1)*dicomheader.PixelSpacing(2) + IPP1; 97 | 98 | % assign properites 99 | mriout = struct('ID', studyID, ... 100 | 'spacing', [dicomheader.PixelSpacing' dicomheader.SliceThickness], ... 101 | 'slices', slices, ... 102 | 'SeriesDescription', dicomheader.SeriesDescription, ... 103 | 'BitDepth', dicomheader.BitDepth, ... 104 | 'rightInd', find(lrIndicator<0), ... 105 | 'leftInd', find(lrIndicator>=0)); 106 | 107 | end 108 | 109 | -------------------------------------------------------------------------------- /wholeBreastSegment.m: -------------------------------------------------------------------------------- 1 | function [segdata] = wholeBreastSegment(dicomdir, savedir, varargin) 2 | %[segdata] = WHOLEBREASTSEGMENT(dicomdir, savedir, varargin) 3 | % Whole breast segmentation in T1w nonfat-suppressed MRI 4 | % 5 | % REQUIRED INPUT: 6 | % - dicomdir: path to the folder from which DICOM files for T1w nonfat- 7 | % suppressed MRI will be read 8 | % - savedir: path to the folder in which the segmentation results will be 9 | % saved 10 | % 11 | % OPTIONAL INPUT (default values/behaviors will be used if unprovided): 12 | % - 'Orientation', 'ax'/'sag': imaging orientation of the input MRI; if 13 | % not provided, the program will try to obtain this information from 14 | % the DICOM header of the input MRI 15 | % - 'ID', char string: user assigned ID for the case to process; if 16 | % undefined, the program with use the 'StudyID' field from the DICOM 17 | % header 18 | % - 'v', float/double: half size of the generic template in mm, default 19 | % value is 2mm, which should work reasonably well in most cases; fine 20 | % tune can be done around 2mm if needed. 21 | % - 'q', float/double: 10^q is the weight for the smoothness cost, 22 | % default value is -1, which should work reasonably well in most cases; 23 | % fine tune can be done around -1 if needed. 24 | % - 'VoxelSize', float/double: isotropic voxel size in mm used during 25 | % whole breast segmentation. The recommended values (1mm and 0.5mm) 26 | % should work well with the default v and q values in most case (the 27 | % smaller the voxel size, the longer it takes). If unspecified, the 28 | % program will determine the voxel size according to the PixelSpacing 29 | % and SliceThickness info from the DICOM header of the input MRI: if 30 | % the finest of the two is below 1mm, 0.5mm will be used; otherwise, 31 | % 1mm is used. 32 | % - 'TemplateDimension', 3 (default) or 2: dimension of the generic and 33 | % self-adapted templates. 3D templates takes significantly more time 34 | % than 2D at a fine voxel resolution (e.g., 0.5mm), but takes almost 35 | % the same time as 2D at a relative coarse voxel resolution (e.g., 36 | % 1mm). Meanwhile, 3D templates seem to be more stable and robust than 37 | % 2D. By default 3D templates are used. 38 | % - 'InterimOutput', true/false(default): if the user wants to save 39 | % intermediate output, e.g., the ROI for the chest-wall line search, as 40 | % images, etc. 41 | % - 'LateralBounds', true/false: if the user wants to define lateral 42 | % bounding planes of the breasts, i.e., the two boundaries on the outer 43 | % sides of the body, to exclude excessive body fat around the armpits. 44 | % The default is true for sagittal data, and false for axial. 45 | % - 'BottomBound', true/false(default): if the user wants to define the 46 | % inferior bounding plane of the breasts to exclude excessive body fat 47 | % at the belly 48 | % - 'MedialBounds', true/false(default): if the user wants to define the 49 | % medial bounding planes of the breasts, i.e., the two boundaries 50 | % in-between the two breasts. 51 | % * CAUTION about the breast bounding planes: the breast bounding plane 52 | % definition algorithms assume excessive non-breast body fat included 53 | % in the breast MR images. If in reality the field of view of the MRI 54 | % is indeed appropriate and the images do not include obviously 55 | % excessive non-breast body fat, you should consider avoid defining (at 56 | % least some of) the bounding planes. Otherwise you might ending up 57 | % with half breasts excluded from the segmented breast mask. 58 | % 59 | % OUTPUT: segdata: a struct that defines the whole breast segmentation 60 | % with the following fields (note: this struct actually contains 61 | % more fields than those listed below; you can safely ignore them 62 | % for now (either intermediate outputs or reserved for future use)) 63 | % - ID: subject ID 64 | % - spacing: image voxel resolution: 65 | % [yPixelSpacing, xPixelSpacing, sliceThickness] 66 | % - slices: actual 3D image matrix: [y, x, z] 67 | % - SeriesDescription: a string extracted from the MRI DICOM header 68 | % describing the imaging sequence protocol 69 | % - rightInd: a vector of positive integers (in assending order) 70 | % corresponding to the part of the input MRI volume that is to the 71 | % right of the mid-chest. For sagittal data, it contains slice 72 | % indices; for axial data, it contains column indices. 73 | % - leftInd: a vector of positive integers (in assending order) 74 | % corresponding to the part of the input MRI volume that is to the 75 | % left of the mid-chest. For sagittal data, it contains slice 76 | % indices; for axial data, it contains column indices. 77 | % - index1: a vector of positive integers (in assending order) 78 | % corresponding to the part of the input MRI volume that contains 79 | % right breast tissue. For sagittal data, it contains slice indices; 80 | % for axial data, it contains column indices. index1 can be equal to, 81 | % or a subset of rightInd. 82 | % - index2: a vector of positive integers (in assending order) 83 | % corresponding to the part of the input MRI volume that contains 84 | % left breast tissue. For sagittal data, it contains slice indices; 85 | % for axial data, it contains column indices. index2 can be equal to, 86 | % or a subset of leftInd. 87 | % - index (exclusive to axial data): a vector of slice indices (in 88 | % asscending order) indicating slices that contain breast tissue. 89 | % - index3 (exclusive to sagittal data): a vector of row indices (in 90 | % asscending order) indicating rows that contain right breast tissue. 91 | % - index4 (exclusive to sagittal data): a vector of row indices (in 92 | % asscending order) indicating rows that contain left breast tissue. 93 | % - CWL_ROI: a 3D volumetric matrix of type logical and of the same 94 | % size as the input MRI volume; true values mark the ROI for the 95 | % chest-wall line search. 96 | % - mask1:a 3D volumetric matrix of the same size as the input MRI 97 | % volume; values above zero comprise the whole breast mask. 98 | % - VT1/VT2/VT: breast volume (cm^3) for the right, left, and both 99 | % breasts 100 | 101 | % parse optional input 102 | p = inputParser; 103 | addParameter(p, 'Orientation', '', @ischar); 104 | addParameter(p, 'ID', '', @ischar); 105 | addParameter(p, 'v', 2); 106 | addParameter(p, 'q', -1); 107 | addParameter(p, 'VoxelSize', []); % isotropic voxel size in mm 108 | addParameter(p, 'TemplateDimension', 3, @(x)(x==2)||(x==3)); 109 | addParameter(p, 'InterimOutput', false, @islogical); 110 | addParameter(p, 'LateralBounds', [], @islogical); 111 | addParameter(p, 'BottomBound', false, @islogical); 112 | addParameter(p, 'MedialBounds', false, @islogical); 113 | parse(p, varargin{:}); 114 | Orientation = p.Results.Orientation; 115 | ID = p.Results.ID; 116 | v = p.Results.v; 117 | q = p.Results.q; 118 | VoxelSize = p.Results.VoxelSize; 119 | TemplateDimension = p.Results.TemplateDimension; 120 | InterimOutput = p.Results.InterimOutput; 121 | LateralBounds = p.Results.LateralBounds; 122 | MedialBounds = p.Results.MedialBounds; 123 | BottomBound = p.Results.BottomBound; 124 | 125 | % determine image orientation 126 | if ~isempty(Orientation) % if user gives imaging orientation 127 | if strcmpi(Orientation, 'ax') 128 | Orientation = 'ax'; 129 | elseif strcmpi(Orientation, 'sag') 130 | Orientation = 'sag'; 131 | else 132 | error('Unexpected imaging orientation! The input breast MRI must be either axial or sagittal.'); 133 | end 134 | else % try to read out this info from dicom 135 | dicomlist = dir(fullfile(dicomdir, '*.dcm')); 136 | if isempty(dicomlist) 137 | dicomlist = dir(dicomdir); 138 | dicomlist = dicomlist(3:end); 139 | end 140 | % read the first dicom file in the given folder 141 | dicomfile = dicomlist(1).name; 142 | dicomheader = dicominfo(fullfile(dicomdir, dicomfile)); 143 | SeriesDescription = dicomheader.SeriesDescription; 144 | if ~isempty(strfind(SeriesDescription,'ax')) || ~isempty(strfind(SeriesDescription,'AX')) || ... 145 | ~isempty(strfind(SeriesDescription,'Ax')) %#ok 146 | Orientation = 'ax'; 147 | elseif ~isempty(strfind(SeriesDescription,'sag')) || ~isempty(strfind(SeriesDescription,'SAG')) || ... 148 | ~isempty(strfind(SeriesDescription,'Sag')) %#ok 149 | Orientation = 'sag'; 150 | else 151 | error('Failed to identify imaging orientation from DICOM header! Please specify either axial or sagittal orientation.'); 152 | end 153 | end 154 | 155 | % call the actual processing function 156 | if strcmpi(Orientation, 'ax') 157 | if isempty(LateralBounds) 158 | LateralBounds = false; 159 | end 160 | segdata = wholeBreastSegmentAx(dicomdir, savedir, 'v', v, 'q', q, 'VoxelSize', VoxelSize, 'TemplateDimension',... 161 | TemplateDimension, 'LateralBounds', LateralBounds, 'BottomBound', BottomBound, 'MedialBounds', MedialBounds, ... 162 | 'InterimOutput',InterimOutput, 'ID',ID); 163 | else 164 | if isempty(LateralBounds) 165 | LateralBounds = true; 166 | end 167 | segdata = wholeBreastSegmentSag(dicomdir, savedir, 'v', v, 'q', q, 'VoxelSize', VoxelSize, 'TemplateDimension',... 168 | TemplateDimension, 'LateralBounds', LateralBounds, 'BottomBound', BottomBound, 'MedialBounds', MedialBounds, ... 169 | 'InterimOutput',InterimOutput, 'ID',ID); 170 | end 171 | 172 | end 173 | 174 | --------------------------------------------------------------------------------