Skip to content
Snippets Groups Projects
Commit 8bc577c7 authored by Eric Wait's avatar Eric Wait
Browse files

Changed the default image loading to brighten all

parent b42a76b9
Branches
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ float4 ViewAlignedVolumePS( VS_OUTPUT input ) : SV_TARGET
color.rgb += (lightMod*intensity*channelColor[i].rgb);
unlitComposite += intensity*channelColor[i].rgb;
alphaComposite += intensity*channelColor[i].rgb*channelColor[i].a;
alphaComposite += intensity*channelColor[i].rgb*channelColor[i].a/2.0f;
}
float maxComponent = max(max(unlitComposite.r,unlitComposite.g),unlitComposite.b);
......
......@@ -13,7 +13,7 @@ function AutoTransferFunction(im)
N = histcounts(curIm(curIm>0),255);
forwardSum = cumsum(N);
lowerBound = forwardSum > sum(N)*0.05;
lowerBound = forwardSum > sum(N)*0.1;
l = find(lowerBound,1,'first');
if (isempty(l))
lb(c) = 0;
......@@ -36,7 +36,7 @@ function AutoTransferFunction(im)
for c=1:size(im,4)
channelData(c).minVal = lb(c)/255;
channelData(c).maxVal = ub(c)/255;
channelData(c).alphaMod = 0.1;
channelData(c).alphaMod = 0.5;
end
D3d.UI.Ctrl.SetUserData(imageData,ucolors,channelData);
D3d.UI.Ctrl.UpdateCurrentState();
......
......@@ -61,7 +61,7 @@ float4 ViewAlignedVolumePS( VS_OUTPUT input ) : SV_TARGET
color.rgb += (lightMod*intensity*channelColor[i].rgb);
unlitComposite += intensity*channelColor[i].rgb;
alphaComposite += intensity*channelColor[i].rgb*channelColor[i].a;
alphaComposite += intensity*channelColor[i].rgb*channelColor[i].a/2.0f;
}
float maxComponent = max(max(unlitComposite.r,unlitComposite.g),unlitComposite.b);
......
%LOADIMAGE D3d.LoadImage( im, bufferNum, frameNumber)
%LOADIMAGE D3d.LoadImage( im, bufferNum, frameNumber, nonNormalized)
function LoadImage( im, bufferNum, frameNumber )
function im8 = LoadImage( im, bufferNum, frameNumber, dontNormalized )
global D3dIsOpen
if (isempty(D3dIsOpen) || ~D3dIsOpen)
error('You need to open the viewer before you can load images! Call D3d.Open first.');
......@@ -20,6 +20,10 @@ function LoadImage( im, bufferNum, frameNumber )
error('You can only load one frame at a time!');
end
if (~exist('nonNormalized','var') || isempty(dontNormalized))
dontNormalized = false;
end
bufferType = 'original';
if (bufferNum==2)
bufferType = 'processed';
......@@ -30,7 +34,11 @@ function LoadImage( im, bufferNum, frameNumber )
im = permute(im,[1,2,5,4,3]);
end
im8 = ImUtils.ConvertType(im,'uint8',true);
if (dontNormalized)
im8 = ImUtils.ConvertType(im,'uint8');
else
im8 = ImUtils.BrightenImages(im,'uint8');
end
if (isempty(frameNumber))
D3d.Viewer.LoadTexture(im8,bufferType);
else
......
......@@ -81,7 +81,7 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
%% open the region chooser if the image is too big
if (any(imData.Dimensions>2048))
D3d.UI.InitializeMipFigure(im,imData,imData.imageDir,true);
D3d.UI.InitializeMipFigure(im,imData);
if (nargout>1)
varargout{2} = [];
end
......@@ -107,17 +107,17 @@ function [varargout] = Open( im, imData, imagePath, mesagePkgStr )
end
if (size(im,5)<imData.NumberOfFrames)
D3d.LoadImage(im(:,:,:,:,1),1,1);
im8 = D3d.LoadImage(im(:,:,:,:,1),1,1);
D3d.Update();
loadTransFunc(imData,im);
loadTransFunc(imData,im8);
for t=2:size(im,5)
D3d.LoadImage(im(:,:,:,:,t),1,t);
end
else
for t=1:size(im,5)
D3d.LoadImage(im(:,:,:,:,t),1,t);
im8 = D3d.LoadImage(im(:,:,:,:,t),1,t);
end
loadTransFunc(imData,im);
loadTransFunc(imData,im8);
D3d.Update();
end
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment