|
237 | 237 | end
|
238 | 238 |
|
239 | 239 | % Get clusters if they are needed
|
240 |
| -if options.clusterThresh ~= 0 | options.grow ~= 0 | strcmpi(options.outline,'map') | strcmpi(options.binarize,'clusters') == 1 | ~isempty(options.priorClusters) |
| 240 | +if options.clusterThresh ~= 0 | options.grow ~= 0 | strcmpi(options.outline,'map') | strcmpi(options.outline,'bins') | strcmpi(options.binarize,'clusters') == 1 | ~isempty(options.priorClusters) |
241 | 241 | if ~isempty(options.UI)
|
242 | 242 | d.Message = ['Finding blobs...this may take some time if you have large blobs in your map'];
|
243 | 243 | d.Value = 0.1;
|
|
302 | 302 | options.clusters = dataClust;
|
303 | 303 | end
|
304 | 304 |
|
| 305 | +% Bin-based outlines are a little different too...we will turn bins into |
| 306 | +% clusters... |
| 307 | +if strcmpi(options.outline,'bins') |
| 308 | + % other outline functions have to occur before colormapping so this is |
| 309 | + % temporary... |
| 310 | + warning('This option is still under development!!! It may break lots of things.') |
| 311 | + [colormapMapTmp,cDataTmp,colormapdataMapTmp,ticksTicksTmp,tickslabelsTmp,m] = colormapper(dataT{:},'colormap',options.colormap{1},'colorSpacing',options.colorSpacing{1},'colorBins',options.colorBins{1},'colorSpecial',options.colorSpecial{1},'invertColors',options.invertColors{1},'limits',[min(options.limits{1}) max(options.limits{1})],'thresh',options.thresh{1}); |
| 312 | + un = unique(m); |
| 313 | + clear dataClust |
| 314 | + for i = 1:length(un) |
| 315 | + dataClust{i} = find(m == un(i)); |
| 316 | + end |
| 317 | +end |
| 318 | + |
305 | 319 | % Turn clusters into boundaries if necessary
|
306 | 320 | if ~strcmpi(options.outline,'none') | options.grow ~= 0
|
307 | 321 | if ~isempty(options.UI)
|
308 | 322 | d.Message = ['Fetching boundary vertices...'];
|
309 | 323 | d.Value = 0.2;
|
310 | 324 | end
|
311 |
| - dataClust_all = dataClust; |
312 |
| - if strcmpi(options.outline,'roi') |
313 |
| - dataClust2 = getClusterBoundary(dataClust, underlays.(hemi).Faces); |
314 |
| - dataClust = cellfun(@(x,y) setdiff(x,intersect(vertcat(dataClust2{:}),x)),dataClust,dataClust2, 'UniformOutput', false); |
315 |
| - end |
316 |
| - |
317 |
| - dataClust = getClusterBoundary(dataClust, underlays.(hemi).Faces); |
318 |
| - hz = horzcat(dataT{:}); |
| 325 | + |
| 326 | + dataClust_all = dataClust; |
| 327 | + if strcmpi(options.outline,'roi') |
| 328 | + dataClust2 = getClusterBoundary(dataClust, underlays.(hemi).Faces); |
| 329 | + dataClust = cellfun(@(x,y) setdiff(x,intersect(vertcat(dataClust2{:}),x)),dataClust,dataClust2, 'UniformOutput', false); |
| 330 | + end |
| 331 | + |
| 332 | + dataClust = getClusterBoundary(dataClust, underlays.(hemi).Faces); |
| 333 | + hz = horzcat(dataT{:}); |
319 | 334 |
|
320 | 335 | for clusteri = 1:length(dataClust)
|
321 | 336 | % if you are doing an outline we need to get mean value for
|
|
474 | 489 | for di = 1:length(dataTS)
|
475 | 490 | %if length(dataTS) == 1 | (length(dataTS) > 1 & (isempty(options.multiCmap) | isempty(options.multiCmapTicks) | isempty(options.multiCbData)))
|
476 | 491 | if length(dataTS) == 1 | length(dataTS) > 1 | isempty(options.multiCmapTicks) | isempty(options.multiCbData)
|
477 |
| - [colormapMapTmp,cDataTmp,colormapdataMapTmp,ticksTicksTmp,tickslabelsTmp] = colormapper(dataTS{di},'colormap',options.colormap{di},'colorSpacing',options.colorSpacing{di},'colorBins',options.colorBins{di},'colorSpecial',options.colorSpecial{di},'invertColors',options.invertColors{di},'limits',[min(options.limits{di}) max(options.limits{di})],'thresh',options.thresh{di}); |
| 492 | + if ~strcmpi(options.outline,'bins') |
| 493 | + [colormapMapTmp,cDataTmp,colormapdataMapTmp,ticksTicksTmp,tickslabelsTmp] = colormapper(dataTS{di},'colormap',options.colormap{di},'colorSpacing',options.colorSpacing{di},'colorBins',options.colorBins{di},'colorSpecial',options.colorSpecial{di},'invertColors',options.invertColors{di},'limits',[min(options.limits{di}) max(options.limits{di})],'thresh',options.thresh{di}); |
| 494 | + end |
478 | 495 | colormap{di}.map = colormapMapTmp;
|
479 | 496 | cData{di} = cDataTmp;
|
480 | 497 | colormap{di}.dataMap = colormapdataMapTmp;
|
|
625 | 642 | % find alpha mapping for each "color" here. transp.map will be this.
|
626 | 643 | % transp.vals can be alph from below.
|
627 | 644 | try
|
628 |
| - transp.map = ones(size(colormap{1}.dataMap))*options.opacity; |
| 645 | + if strcmpi(options.colorSpacing,'even') |
| 646 | + transp.map = ones(1,length(colormap{1}.dataMap)-1)*options.opacity; |
| 647 | + else |
| 648 | + transp.map = ones(size(colormap{1}.dataMap))*options.opacity; |
| 649 | + end |
629 | 650 | catch
|
630 | 651 | transp.map = ones(size(options.multiCbData,1),1)*options.opacity;
|
631 | 652 | end
|
632 | 653 |
|
| 654 | + |
633 | 655 | % if strcmpi(options.inclZero,'off') & isempty(s)
|
634 | 656 | % id = find(all(horzcat(dataTS{:}) == 0,2)==1);
|
635 | 657 | % transp.vals(id) = 0;
|
|
0 commit comments