Commit d64f21a3 authored by Johannes Maul's avatar Johannes Maul
Browse files

ExampleCorrection.

Meshing method is diffrent. It is important how the mesh looks like for the calculation
parent 3ed32957
......@@ -28,18 +28,18 @@ function easyExample(exampleType, buildDefault)
end
if exampleType == "easy"
testVolumeSize = [100 120 50];
testVolume = ones(testVolumeSize);
testVolume(10:90,10:90,10:40) = 2;
testVolume = ones(testVolumeSize)+1;
testVolume(10:90,10:90,10:40) = 1;
testVolume(30:70,30:70,15:35) =3;
isoValues = [0.5, 1.5,2.5];
isoValues = [0.5,1.5,2.5];
source = [testVolumeSize(2)/2 testVolumeSize(1)/2 testVolumeSize(3)*10];%centered above the test volume
attenuationCoefficentValues = [ -0.3403, -0.1500, -0.3783];%1 = gland, 2=fat,3=muscle
attenuationCoefficentValues = [0.15,0.34 , 0.38];%1 = gland, 2=fat,3=muscle
end
[nodes,faces] = vol2surf(testVolume,1:testVolumeSize(1),1:testVolumeSize(2),1:testVolumeSize(3),1.5,1,'cgalsurf',isoValues);
[nodes,~,faces] = vol2mesh(uint8(testVolume),1:testVolumeSize(1),1:testVolumeSize(2),1:testVolumeSize(3),1.5,1.5,1,'cgalmesh',isoValues);
faces = unique(faces,'rows'); %special for vol2mesh were the outer layer got an air layer which destroys the calculation
faces(:,4) = faces(:,4) - 1; %currently non dynamic labels
nodes(:,1:2) = nodes(:,1:2) +10;
% faces(:,4) = faces(:,4) - 1; %currently non dynamic labels
% nodes(:,1:2) = nodes(:,1:2) +10;
end
[projection,debug, debugMiss, profiling] = nv_ray_tracing_basic(detectorPositionCoordinates, faces, nodes, source, detectorSizeUint,attenuationCoefficentValues' ); %parameters always in this order
......@@ -47,7 +47,7 @@ function easyExample(exampleType, buildDefault)
% debugMissFormated = reshape(debugMiss,[200 detectorSizeUint(1) detectorSizeUint(2)]);
projectionAsImage = reshape(projection,detectorSizeUint);
figure; imagesc(projectionAsImage); axis image; colormap('gray');
figure; imagesc(-projectionAsImage); axis image; colormap('gray');
end
function [sizeX, sizeY, detectorPositions] = createOwnExample(exampleType)
......
......@@ -58,7 +58,9 @@ void main()
uint n = uint(rayPayload.hitCounter - mod(rayPayload.hitCounter, 2)); //Abschnitt getestet, indem verglichen mit Matlab. Bei Ungleichheit stop. Kein Stop => ERg = gleich
debug.values[rayPayload.outputId] = n;
if (n > sizeZ )
n = sizeZ-2;
{
n = sizeZ;
}
//permutation: sortieren nach kleinster distanz
uint permutationIndices[sizeZ];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment