diff --git a/Modules/PhotoacousticSimulation/src/Algorithms/mitkPhotoacousticFatTissueGenerator.cpp b/Modules/PhotoacousticSimulation/src/Algorithms/mitkPhotoacousticFatTissueGenerator.cpp index bedaa8412a..5fa219aaa0 100644 --- a/Modules/PhotoacousticSimulation/src/Algorithms/mitkPhotoacousticFatTissueGenerator.cpp +++ b/Modules/PhotoacousticSimulation/src/Algorithms/mitkPhotoacousticFatTissueGenerator.cpp @@ -1,51 +1,54 @@ #include "mitkPhotoacousticFatTissueGenerator.h" #include #include #include void mitk::PhotoacousticFatTissueGenerator::CreateFatGlobules(mitk::PhotoacousticVolume::Pointer image, double bodyFatPercentage, double fatAbsorption, double fatScattering, double fatAnisotropy, std::mt19937* rng) { + if (bodyFatPercentage < mitk::eps) + return; + const double VOLUME_CONSTANT = 4.0 / 3.0 * 3.14159265359; const double NORMAL_DISTRIBUTION_SIGMA = 0.2; const double MINIMUM_FAT_GLOBULES_FACTOR = 0.83; const double MAXIMUM_FAT_GLOBULES_FACTOR = 1.2; int xDim = image->getXDim(); int yDim = image->getYDim(); int zDim = image->getZDim(); long length = xDim*yDim*zDim; double sqrtLength = 2 * sqrt(sqrt(length)); std::uniform_int_distribution<> numberOfFatGlobulesDist(MINIMUM_FAT_GLOBULES_FACTOR*sqrtLength, MAXIMUM_FAT_GLOBULES_FACTOR*sqrtLength); std::normal_distribution<> normalDistribution(1, NORMAL_DISTRIBUTION_SIGMA); int numberOfFatGlobules = numberOfFatGlobulesDist(*rng); double radius = pow(length*bodyFatPercentage/100.0/(numberOfFatGlobules * VOLUME_CONSTANT), (1.0/3.0)); std::uniform_int_distribution<> xDist(-radius, xDim+radius); std::uniform_int_distribution<> yDist(-radius, yDim+radius); std::uniform_int_distribution<> zDist(1.5*radius, zDim+radius); for(int fatGlobuleIdx = 0; fatGlobuleIdxSetVolumeValues(x, y, z, fatAbsorption, fatScattering, fatAnisotropy, mitk::PhotoacousticVolume::SegmentationType::FAT); } } } } diff --git a/Plugins/org.mitk.gui.qt.photoacousticsimulation/src/internal/PASimulatorControls.ui b/Plugins/org.mitk.gui.qt.photoacousticsimulation/src/internal/PASimulatorControls.ui index 7bb3e4111b..7c498fab04 100644 --- a/Plugins/org.mitk.gui.qt.photoacousticsimulation/src/internal/PASimulatorControls.ui +++ b/Plugins/org.mitk.gui.qt.photoacousticsimulation/src/internal/PASimulatorControls.ui @@ -1,4881 +1,4881 @@ PASimulatorControls 0 0 433 655 0 0 Qt::NoContextMenu QmitkTemplate :/org.mitk.gui.qt.photoacousticsimulation/resources/icon.xpm:/org.mitk.gui.qt.photoacousticsimulation/resources/icon.xpm 0 0 415 600 - 0 + 1 Generator 10 10 391 581 0 0 391 581 0 0 0 0 75 true Volume parameters 0 0 0 25 16777215 25 Tissue name: 0 0 0 25 16777215 25 Size x: 0 0 0 25 16777215 25 50 false Spacing: 0 0 0 25 16777215 25 PhotoacousticTissue 0 0 0 25 16777215 25 1 9999 70 0 0 0 25 16777215 25 y: 0 0 0 25 16777215 25 9999 100 0 0 0 25 16777215 25 z: 0 0 0 25 16777215 25 9999 70 0 0 0 25 16777215 25 voxels Qt::Horizontal 40 20 0 0 0 25 16777215 25 2 0.010000000000000 0.060000000000000 0 0 0 25 16777215 25 cm Qt::Horizontal 40 20 0 0 0 25 16777215 25 Randomize: 0 0 0 25 16777215 25 Partial volume effects: 0 0 0 25 16777215 25 Custom seed: 0 0 0 25 16777215 25 true true 0 0 0 25 16777215 25 true 0 0 0 25 16777215 25 0 0 0 25 16777215 25 sigma: 0 0 0 25 16777215 25 0 100.000000000000000 0.010000000000000 2.000000000000000 0 0 0 25 16777215 25 % Qt::Horizontal 40 20 0 0 0 25 16777215 25 sigma: 0 0 0 25 16777215 25 10.000000000000000 0.100000000000000 1.000000000000000 0 0 0 25 16777215 25 voxels Qt::Horizontal 40 20 0 0 0 25 16777215 25 999999999 170704057 Qt::Horizontal 40 20 Generate batch file output: false Number of volumes to generate: 1 9999999 1 Qt::Horizontal 40 20 Save generated tissue path: 0 0 50 0 50 16777215 open Path to MitkMcxyz binary: 0 0 50 0 50 16777215 open Number of Photons (x1000): 0 999999999 1 100000 0 0 Generate Tissue Qt::Vertical 20 40 Tissue 10 10 391 581 0 0 391 581 0 0 0 0 0 0 0 25 16777215 25 11 75 false true false Air Parameters 0 0 0 25 16777215 25 50 false Thickness: 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 false true false Background Parameters 0 0 0 25 16777215 25 Absorption coefficient: 0 0 0 25 16777215 25 Scattering coefficient: 0 0 0 25 16777215 25 Anisotropy facor: 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 false true false Skin Parameters 0 0 0 25 16777215 25 Thickness: 0 0 0 25 16777215 25 Absorption coefficient: 0 0 0 25 16777215 25 Scattering coefficient: 0 0 0 25 16777215 25 Anisotropy facor: 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 false true false Fat Parameters - + 0 0 0 25 16777215 25 - Anisotropy facor: + Body fat percentage: - + 0 0 0 25 16777215 25 - Scattering coefficient: + Absorption coefficient: - + 0 0 0 25 16777215 25 - Absorption coefficient: + Scattering coefficient: - + 0 0 0 25 16777215 25 - Body fat percentage: + Anisotropy facor: 0 0 0 25 16777215 25 11 75 true 0 0 0 25 16777215 25 0.100000000000000 1.800000000000000 0 0 0 25 16777215 25 mm Qt::Horizontal 40 20 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 true 0 0 0 25 16777215 25 0.100000000000000 0.100000000000000 0 0 0 25 16777215 25 per cm Qt::Horizontal 40 20 0 0 0 25 16777215 25 1000.000000000000000 15.000000000000000 0 0 0 25 16777215 25 per cm Qt::Horizontal 40 20 0 0 0 25 16777215 25 1.000000000000000 0.010000000000000 0.900000000000000 Qt::Horizontal 40 20 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 true 0 0 0 25 16777215 25 0.100000000000000 0.400000000000000 0 0 0 25 16777215 25 mm Qt::Horizontal 40 20 0 0 0 25 16777215 25 0.100000000000000 3.000000000000000 0 0 0 25 16777215 25 per cm Qt::Horizontal 40 20 0 0 0 25 16777215 25 1000.000000000000000 20.000000000000000 0 0 0 25 16777215 25 per cm Qt::Horizontal 40 20 0 0 0 25 16777215 25 1.000000000000000 0.010000000000000 0.900000000000000 Qt::Horizontal 40 20 0 0 0 10 16777215 10 11 75 true 0 0 0 25 16777215 25 75 true 0 0 0 25 16777215 25 0 0.100000000000000 10.000000000000000 0 0 0 25 16777215 25 % Qt::Horizontal 40 20 - + - + 0 0 0 25 16777215 25 - - 0.100000000000000 + + 1000.000000000000000 - 0.200000000000000 + 18.000000000000000 - + 0 0 0 25 16777215 25 per cm - + Qt::Horizontal 40 20 - + - + 0 0 0 25 16777215 25 - - 1000.000000000000000 + + 0.100000000000000 - 18.000000000000000 + 0.200000000000000 - + 0 0 0 25 16777215 25 per cm - + Qt::Horizontal 40 20 0 0 0 25 16777215 25 1.000000000000000 0.010000000000000 0.900000000000000 Qt::Horizontal 40 20 Qt::Vertical 20 40 Vessels 10 10 391 581 0 0 391 581 0 0 0 0 75 true Vessel Parameters 0 25 16777215 25 The number of bloos vessels to generate Count: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 25 16777215 25 The radius of the blood vessels in mm Radius: 0 25 16777215 25 the absorption coefficient refers to the number of absorption events per centimeter. Absorption: 0 25 16777215 25 The reduced scattering coefficient. It refers to the amount of scattering events per centimeter. Scattering: 0 25 16777215 25 The anisotropy factor is the probability of a photon to not change its direction after a scattering event. Anisotropy factor: 0 25 16777215 25 The bifurcation frequency determines how often the vessel should bifurcate. The vessel will bifurcate after meandering a mean of the specified amount of voxels. When given a value of 0, the vessel will never bifurcate. Bifurcation frequency: 0 25 16777215 25 The curvedness it a setting to determine how much the vessel is allowed to bend during creation. A value of 0 refers to no bending at all and a value of 5 is the maximum. Curvedness: 0 25 16777215 25 The minimum number of blood vessels 1 1 0 25 16777215 25 to 0 25 16777215 25 The maximum number of blood vessels 7 0 25 16777215 25 Vessels Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The minimum radius 0.600000000000000 0 25 16777215 25 to 0 25 16777215 25 The maximum radius 5.000000000000000 0 25 16777215 25 mm Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The minimum absorption coefficient 2.000000000000000 0 25 16777215 25 to 0 25 16777215 25 The maximum absorption coefficient 10.000000000000000 0 25 16777215 25 per cm Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The minimum scattering 2 0.000000000000000 999.000000000000000 1.000000000000000 15.000000000000000 0 25 16777215 25 to 0 25 16777215 25 The minimum scattering 2 0.000000000000000 999.000000000000000 1.000000000000000 15.000000000000000 0 25 16777215 25 per cm Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The minimum anisotropy factor 2 0.000000000000000 1.000000000000000 0.100000000000000 0.900000000000000 0 25 16777215 25 to 0 25 16777215 25 The maximum anisotropy factor 2 0.000000000000000 1.000000000000000 0.100000000000000 0.900000000000000 Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The bifurcation frequency determines how often the vessel should bifurcate. The vessel will bifurcate after meandering a mean of the specified amount of voxels. When given a value of 0, the vessel will never bifurcate. 0 1.000000000000000 999999999.000000000000000 1.000000000000000 50.000000000000000 0 25 16777215 25 voxels Qt::Horizontal QSizePolicy::Expanding 60 20 0 25 16777215 25 The minimal curvedness of the vessel. A value of 0 refers to no bending at all and a value of 5 is the maximum. 5.000000000000000 0.100000000000000 0 25 16777215 25 to 0 25 16777215 25 The maximal curvedness of the vessel. A value of 0 refers to no bending at all and a value of 5 is the maximum. 5.000000000000000 0.010000000000000 1.000000000000000 0 25 16777215 25 units Qt::Horizontal QSizePolicy::Expanding 60 20 Qt::Vertical 20 40 Monte Carlo 10 10 391 581 0 0 391 581 0 0 0 0 75 true Monte Carlo Parameters 0 25 16777215 25 50 false General: 0 0 0 25 16777215 25 Mcflag: 0 0 0 25 16777215 25 Launchflag: 0 0 0 25 16777215 25 Boundaryflag: 0 0 0 25 16777215 25 1 4 Qt::Horizontal 40 20 0 0 0 25 16777215 25 0 0 Qt::Horizontal 40 20 0 0 0 25 16777215 25 1 2 Qt::Horizontal 40 20 0 25 16777215 25 50 false Initial launch point: 0 25 16777215 25 x 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 0 25 16777215 25 y 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 0 25 16777215 25 z 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 Qt::Horizontal 40 20 0 25 16777215 25 50 false Focus point: 0 25 16777215 25 x 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 0 25 16777215 25 y 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 0 25 16777215 25 z 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 Qt::Horizontal 40 20 0 25 16777215 25 50 false Trajectory vector: 0 25 16777215 25 x 0 25 16777215 25 4 1000000.000000000000000 0.000000000000000 0 25 16777215 25 y 0 25 16777215 25 4 1000000.000000000000000 0.342000000000000 0 25 16777215 25 z 0 25 16777215 25 4 1000000.000000000000000 0.939700000000000 Qt::Horizontal 40 20 radius: waist: 4 1000.000000000000000 0.500000000000000 Qt::Horizontal 40 20 4 1000.000000000000000 0.010000000000000 Qt::Horizontal 40 20 Qt::Vertical 20 40 Wavelength 10 10 391 581 0 0 391 581 Qt::NoContextMenu 0 0 0 0 75 true Adjust physical properties by wavelength false 16777215 150 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This widget enables the adjustment of the physical properties of the tissue according to a selected wavelength of the light and the oxygen saturation of the blood.</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The algorithm and measurements were provided by the publication <span style=" font-weight:600;">Optical properties of biological tissues: a review </span>by Steve L. Jacques.</p></body></html> 0 0 0 25 16777215 25 Wavelength: 0 0 0 25 16777215 25 Vessel oxygen saturation: 0 0 0 25 16777215 25 0 300.000000000000000 1000.000000000000000 650.000000000000000 Qt::Horizontal 40 20 0 0 0 25 16777215 25 0 100.000000000000000 75.000000000000000 0 0 0 25 16777215 25 % Qt::Horizontal 40 20 Adjust tissue properties Qt::Vertical 20 40