2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 8b9986d2 authored by schultezub's avatar schultezub
Browse files

litte bug fix in MhdImageReader

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@484 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 943b5ffb
......@@ -145,6 +145,12 @@ namespace campvis {
else if (dimensionality == 2)
imageOffset = tgt::vec3(tfp.getVec2("Position"), 0.f);
}
if (tfp.hasKey("VolumePosition")) {
if (dimensionality == 3)
imageOffset = tfp.getVec3("VolumePosition");
else if (dimensionality == 2)
imageOffset = tgt::vec3(tfp.getVec2("VolumePosition"), 0.f);
}
if (tfp.hasKey("ElementNumberOfChannels")) {
numChannels = tfp.getSizeT("ElementNumberOfChannels");
}
......@@ -180,7 +186,7 @@ namespace campvis {
// all parsing done - lets create the image:
ImageData* image = new ImageData(dimensionality, size, numChannels);
ImageRepresentationDisk::create(image, url, pt, offset, e);
image->setMappingInformation(ImageMappingInformation(size, imageOffset + p_imageOffset.getValue(), voxelSize + p_voxelSize.getValue()));
image->setMappingInformation(ImageMappingInformation(size, imageOffset + p_imageOffset.getValue(), voxelSize * p_voxelSize.getValue()));
data.addData(p_targetImageID.getValue(), image);
p_targetImageID.issueWrite();
}
......
Markdown is supported
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