engine issueshttps://gitlab.kitware.com/physiology/engine/-/issues2023-06-06T14:03:32-04:00https://gitlab.kitware.com/physiology/engine/-/issues/43Breaking changes in 4.2.0?2023-06-06T14:03:32-04:00marinierBreaking changes in 4.2.0?It appears that breaking changes were introduced in 4.2.0 (which isn't released yet?), at least on the Java side. Specifically the things I've run into include:
* `SEHemorrhage::setCompartment`'s argument changed from type `com.kitware....It appears that breaking changes were introduced in 4.2.0 (which isn't released yet?), at least on the Java side. Specifically the things I've run into include:
* `SEHemorrhage::setCompartment`'s argument changed from type `com.kitware.pulse.cdm.patient.actions.SEHemorrhage.ExternalCompartment` to `com.kitware.pulse.cdm.bind.PatientActions.HemorrhageData.eCompartment`.
* The `LogListener` class's methods (e.g., `handleDebug`) no longer take a `Throwable` as a second argument.
None of this is a big deal to me. I only raise it because you guys use semantic versioning and didn't change the major version number, so I thought perhaps these changes were unintentional and wanted to bring them to your attention.https://gitlab.kitware.com/physiology/engine/-/issues/42Updated java dependencies2023-04-18T09:13:24-04:00marinierUpdated java dependenciesSince there will be a new release soon, I've gathered updated java dependencies (see below). However, when I try to build pulse with these dependencies and the updated cmake file below, I get these errors:
```
4>------ Build started: Pr...Since there will be a new release soon, I've gathered updated java dependencies (see below). However, when I try to build pulse with these dependencies and the updated cmake file below, I get these errors:
```
4>------ Build started: Project: PulseData, Configuration: Release x64 ------
4>-- Found Java: C:/Program Files/Eclipse Adoptium/jdk-11.0.17.8-hotspot/bin/java.exe (found version "11.0.17")
4>-- Using JAVA_HOME as my Java executable (set to : C:/Program Files/Eclipse Adoptium/jdk-11.0.17.8-hotspot)
4>EXEC : error : Unable to initialize main class com.kitware.pulse.dataset.DataSetReader
4>Caused by: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row
4>EXEC : error : Unable to initialize main class com.kitware.pulse.dataset.ValidationDataSetReader
4>Caused by: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row
4>-- Found Java: C:/Program Files/Eclipse Adoptium/jdk-11.0.17.8-hotspot/bin/java.exe (found version "11.0.17")
4>-- Using JAVA_HOME as my Java executable (set to : C:/Program Files/Eclipse Adoptium/jdk-11.0.17.8-hotspot)
4>[INFO] Loading native library : PulseJNI
4>[ERROR] verification_dir set to invalid directory C:/Users/bob.marinier/git/isaac/pulse-engine/build/install/bin/verification, ignoring and using default (./)
4>[WARN] Unknown directive : NoPlot
4>[WARN] Cannot find files, ./patients is not a directory
4>[INFO] I can run 12 threads, I am going to use 11
4>Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
4> at com.google.protobuf.util.JsonFormat$PrinterImpl$GsonHolder.<clinit>(JsonFormat.java:725)
4> at com.google.protobuf.util.JsonFormat$PrinterImpl.<init>(JsonFormat.java:745)
4> at com.google.protobuf.util.JsonFormat$Printer.appendTo(JsonFormat.java:358)
4> at com.google.protobuf.util.JsonFormat$Printer.print(JsonFormat.java:378)
4> at com.kitware.pulse.cdm.testing.SETestReport.writeFile(SETestReport.java:123)
4> at com.kitware.pulse.cdm.testing.SETestReport.write(SETestReport.java:190)
4> at com.kitware.pulse.cdm.testing.SETestReport.write(SETestReport.java:183)
4> at com.kitware.pulse.cdm.testing.SETestDriver.createReport(SETestDriver.java:380)
4> at com.kitware.pulse.cdm.testing.SETestDriver.test(SETestDriver.java:145)
4> at com.kitware.pulse.cdm.testing.SETestDriver.main(SETestDriver.java:44)
4>Caused by: java.lang.ClassNotFoundException: com.google.gson.GsonBuilder
4> at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
4> at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
4> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
4> ... 10 more
```
I checked the jars and the classes it's complaining about are definitely in the jar dependencies. Maybe I have to update another cmake file somewhere to make sure they end up on the classpath when this runs?
I'm building on Windows 10 with Visual Studio 2019. I tried with both Java 8 and 11.
This is all of the dependencies, some of which have not changed versions:
[commons-collections4-4.4.jar](/uploads/d9745a541f27ce78ac523ff0a1329a12/commons-collections4-4.4.jar)
[commons-compress-1.21.jar](/uploads/f55d14aaa625655d3281aa119fe7c284/commons-compress-1.21.jar)
[commons-io-2.11.0.jar](/uploads/8fefd100c587d54e6021579305d134b6/commons-io-2.11.0.jar)
[commons-math3-3.6.1.jar](/uploads/5c56050e7b4091743ae9230189c8319b/commons-math3-3.6.1.jar)
[error_prone_annotations-2.11.0.jar](/uploads/dd8df0acb639b15cef47f0fe68d287b2/error_prone_annotations-2.11.0.jar)
[gson-2.10.1.jar](/uploads/ce97952679193e6a83b3406a1da6eea2/gson-2.10.1.jar)
[guava-31.1-jre.jar](/uploads/8573bb15591e52d388b10ab1337d147c/guava-31.1-jre.jar)
[j2objc-annotations-1.3.jar](/uploads/9c2fcb401900e2d5f829c86669be2478/j2objc-annotations-1.3.jar)
[java-ordered-properties-1.0.4.jar](/uploads/53844ff4433659f1e0f71125b5879660/java-ordered-properties-1.0.4.jar)
[javassist-3.28.0-GA.jar](/uploads/d9c186d02448c4bf4bf5bd52536ad46c/javassist-3.28.0-GA.jar)
[jfreechart-1.5.4.jar](/uploads/c65fdf5d4258237cf3d925d3cd8fdcd6/jfreechart-1.5.4.jar)
[jsr305-3.0.2.jar](/uploads/728f9c55a6a82d73f395535ca86df406/jsr305-3.0.2.jar)
[log4j-api-2.20.0.jar](/uploads/4ed1e3daa667af41ff4f14da6a8b11ea/log4j-api-2.20.0.jar)
[log4j-core-2.20.0.jar](/uploads/cbeeadef9f307ff8f47522920e7a59bb/log4j-core-2.20.0.jar)
[logback-core-1.4.6.jar](/uploads/bfc795c31f693fe77b2e708a7ce20696/logback-core-1.4.6.jar)
[poi-5.2.3.jar](/uploads/e0c45c2e4d38d5a635162676505a46e9/poi-5.2.3.jar)
[poi-ooxml-5.2.3.jar](/uploads/41f458f484c37b7482fea4059cad8fe9/poi-ooxml-5.2.3.jar)
[poi-ooxml-lite-5.2.3.jar](/uploads/fe160ca68756df5404bbfb6e6a511058/poi-ooxml-lite-5.2.3.jar)
[reflections-0.10.2.jar](/uploads/8ff0f9eb69412c75e9a20f70da87830c/reflections-0.10.2.jar)
[slf4j-api-2.0.7.jar](/uploads/d3dfd7f9eafeddc795e47a0b22b3da6f/slf4j-api-2.0.7.jar)
[slf4j-simple-2.0.7.jar](/uploads/e832d659f52b7762c56a5303a54efd26/slf4j-simple-2.0.7.jar)
[xmlbeans-5.1.1.jar](/uploads/586e6a2e0452a364cdd0b94011dce1bd/xmlbeans-5.1.1.jar)
And here is the corresponding updated cmake file:
[CMakeLists.txt](/uploads/2d482a783f4cf23d444f74054ef46e8b/CMakeLists.txt)Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/40Python binding build issues2023-03-10T10:13:47-05:00Austin Baird, PhDPython binding build issuesLooks like the Python bindings wont build due to ssize_t being undefined in the numpy.h file that is included in the external programs. Seems like a pybind issue, was able to find a fix here:
https://stackoverflow.com/questions/7004664...Looks like the Python bindings wont build due to ssize_t being undefined in the numpy.h file that is included in the external programs. Seems like a pybind issue, was able to find a fix here:
https://stackoverflow.com/questions/70046641/i-am-unable-to-install-face-recognition-library
might be an issue for me to list to pybind but since you are hosting your own external repositories you could potentially patch it? Up to you.https://gitlab.kitware.com/physiology/engine/-/issues/36Updated Java dependencies2022-03-07T09:46:35-05:00marinierUpdated Java dependenciesSorry I didn't post these in time for the 4.1 release, but better late than never! These are the updated jars to support the Java interface. Some of them include security fixes. I am posting the "complete" set, as claimed by maven, but i...Sorry I didn't post these in time for the 4.1 release, but better late than never! These are the updated jars to support the Java interface. Some of them include security fixes. I am posting the "complete" set, as claimed by maven, but it the actual set you need is likely smaller, as you don't use every method of every library. It may be that just grabbing the updates for the jars you already have is sufficient.
I tested these updated versions on Windows 10 without issue.
Also FYI, the 4.1 release contains two versions of the guava jar.
[checker-qual-3.12.0.jar](/uploads/c52b8d2545e313a31e29aec9214b9507/checker-qual-3.12.0.jar)
[commons-codec-1.15.jar](/uploads/3bc15b3a509630cbd09bd10c81098010/commons-codec-1.15.jar)
[commons-collections4-4.4.jar](/uploads/2e8873c0485dc5a678fefe23b34553bc/commons-collections4-4.4.jar)
[commons-compress-1.21.jar](/uploads/dc434476277b0c0da7c73295303b05be/commons-compress-1.21.jar)
[commons-io-2.11.0.jar](/uploads/f480943d86336135190ba23c0fe5ec00/commons-io-2.11.0.jar)
[commons-math3-3.6.1.jar](/uploads/26d2f8797a0784f08f4c8d0fa2efe22d/commons-math3-3.6.1.jar)
[curvesapi-1.06.jar](/uploads/6d879a700c5bfec9a0d279f63c60de3b/curvesapi-1.06.jar)
[error_prone_annotations-2.11.0.jar](/uploads/f4ab883e63aaaf223c4c3e464b49f165/error_prone_annotations-2.11.0.jar)
[failureaccess-1.0.1.jar](/uploads/3ad5987dc18f2f26c7ea20da27c12e59/failureaccess-1.0.1.jar)
[gson-2.9.0.jar](/uploads/6460d04332d1cd20bf255ed6187c9382/gson-2.9.0.jar)
[guava-31.1-jre.jar](/uploads/c3951766fffad8ee482f538afe089f3d/guava-31.1-jre.jar)
[j2objc-annotations-1.3.jar](/uploads/12b1dee992ca3d635121acd182c01682/j2objc-annotations-1.3.jar)
[java-ordered-properties-1.0.4.jar](/uploads/e1db7d674199541fe9e4849775c8fe05/java-ordered-properties-1.0.4.jar)
[javassist-3.28.0-GA.jar](/uploads/156a93e9f34e688a54013936aff18da3/javassist-3.28.0-GA.jar)
[jfreechart-1.5.3.jar](/uploads/8154188517a44393f681eada3c8358e3/jfreechart-1.5.3.jar)
[jsr305-3.0.2.jar](/uploads/e46a4ab4036fc0ac21b3649fb6175e93/jsr305-3.0.2.jar)
[listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar](/uploads/842d040e70ccb7831dbf1eee9392eca0/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar)
[log4j-over-slf4j-1.7.36.jar](/uploads/0f02cb576991b9fd48f5da6307784276/log4j-over-slf4j-1.7.36.jar)
[logback-classic-1.2.10.jar](/uploads/25901d237256fccf1552884c741764b5/logback-classic-1.2.10.jar)
[logback-core-1.2.10.jar](/uploads/dc36a769a5933171ccd27cc4b0595b5d/logback-core-1.2.10.jar)
[poi-5.2.0.jar](/uploads/5af111542b0de1137834f5e341493943/poi-5.2.0.jar)
[poi-ooxml-5.2.0.jar](/uploads/4c2837fd3a0aa3255b594d62136e450a/poi-ooxml-5.2.0.jar)
[poi-ooxml-lite-5.2.0.jar](/uploads/17bfcdf946261a6f3f6922396d65fd2b/poi-ooxml-lite-5.2.0.jar)
[reflections-0.10.2.jar](/uploads/de3d4ca6270b13a6bc484fc2e05daa14/reflections-0.10.2.jar)
[slf4j-api-1.7.36.jar](/uploads/35b11ebc24d69488f56d9ba67bd7aceb/slf4j-api-1.7.36.jar)
[SparseBitSet-1.2.jar](/uploads/ac2a8dfbdf84228c2976b77546fd195f/SparseBitSet-1.2.jar)
[xmlbeans-5.0.3.jar](/uploads/4474273359f523af0737fbaacceb5f20/xmlbeans-5.0.3.jar)Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/35Fix build on Linux2021-12-16T13:32:42-05:00asntFix build on LinuxI had to add an explicit import for `<limits>` for the engine to build.
- branch: 3.x
- revision: 4d041c2
- GNU C++17 (GCC) version 11.1.0 (x86_64-pc-linux-gnu)
```diff
diff --git a/src/cpp/cdm/compartment/fluid/SEGasCompartment.cpp b/...I had to add an explicit import for `<limits>` for the engine to build.
- branch: 3.x
- revision: 4d041c2
- GNU C++17 (GCC) version 11.1.0 (x86_64-pc-linux-gnu)
```diff
diff --git a/src/cpp/cdm/compartment/fluid/SEGasCompartment.cpp b/src/cpp/cdm/compartment/fluid/SEGasCompartment.cpp
index 9880e35c..624bb1da 100644
--- a/src/cpp/cdm/compartment/fluid/SEGasCompartment.cpp
+++ b/src/cpp/cdm/compartment/fluid/SEGasCompartment.cpp
@@ -8,6 +8,8 @@
#include "properties/SEScalar0To1.h"
#include "utils/GeneralMath.h"
+#include <limits>
+
SEGasCompartment::SEGasCompartment(const std::string& name, Logger* logger) : SEFluidCompartment(name, logger)
{
diff --git a/src/cpp/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp b/src/cpp/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp
index 3f3c3daa..6bbc3469 100644
--- a/src/cpp/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp
+++ b/src/cpp/cdm/compartment/substances/SELiquidSubstanceQuantity.cpp
@@ -18,6 +18,8 @@
#include "properties/SEScalarMassPerAmount.h"
#include "utils/GeneralMath.h"
+#include <limits>
+
SELiquidSubstanceQuantity::SELiquidSubstanceQuantity(SESubstance& sub, SELiquidCompartment& compartment) : SESubstanceQuantity(sub), m_Compartment(compartment)
{
m_Concentration = nullptr;
@@ -590,4 +592,4 @@ void SELiquidSubstanceQuantity::AddChild(SELiquidSubstanceQuantity& subQ)
{
if (!Contains(m_Children, subQ))
m_Children.push_back(&subQ);
-}
\ No newline at end of file
+}
diff --git a/src/cpp/cdm/properties/SEScalar.cpp b/src/cpp/cdm/properties/SEScalar.cpp
index f564b3d8..252f7dbc 100644
--- a/src/cpp/cdm/properties/SEScalar.cpp
+++ b/src/cpp/cdm/properties/SEScalar.cpp
@@ -5,6 +5,8 @@
#include "properties/SEScalar.h"
#include "utils/GeneralMath.h"
+#include <limits>
+
// Declare template classes all Scalar types at the bottom
unsigned long long int SEScalar::NaN =
diff --git a/src/cpp/cdm/utils/DataTrack.h b/src/cpp/cdm/utils/DataTrack.h
index 0a00a516..d7a380ca 100644
--- a/src/cpp/cdm/utils/DataTrack.h
+++ b/src/cpp/cdm/utils/DataTrack.h
@@ -5,6 +5,7 @@
#include <iostream>
#include <iomanip>
+#include <limits>
class SESubstance;
class SEElectricalCircuit;
class SEFluidCircuit;
diff --git a/src/cpp/cdm/utils/unitconversion/UnitConversionEngine.cpp b/src/cpp/cdm/utils/unitconversion/UnitConversionEngine.cpp
index 8140b9bf..b6a33d75 100644
--- a/src/cpp/cdm/utils/unitconversion/UnitConversionEngine.cpp
+++ b/src/cpp/cdm/utils/unitconversion/UnitConversionEngine.cpp
@@ -11,6 +11,7 @@
#include <algorithm>
#include <cctype>
+#include <limits>
CUnitConversionEngine* CUnitConversionEngine::uce=nullptr;
diff --git a/src/cpp/cpm/controller/SetupCircuitsAndCompartments.cpp b/src/cpp/cpm/controller/SetupCircuitsAndCompartments.cpp
index d9e417f5..0bc1da89 100644
--- a/src/cpp/cpm/controller/SetupCircuitsAndCompartments.cpp
+++ b/src/cpp/cpm/controller/SetupCircuitsAndCompartments.cpp
@@ -40,6 +40,8 @@
#include "properties/SEScalarMass.h"
#include "properties/SEScalarMassPerMass.h"
+#include <limits>
+
bool PulseController::CreateCircuitsAndCompartments()
{
m_Circuits->Clear();
diff --git a/src/cpp/cpm/environment/Environment.cpp b/src/cpp/cpm/environment/Environment.cpp
index 484ec086..3743dac0 100644
--- a/src/cpp/cpm/environment/Environment.cpp
+++ b/src/cpp/cpm/environment/Environment.cpp
@@ -56,6 +56,8 @@
#include "properties/SEScalarMass.h"
#include "properties/SEScalarLength.h"
+#include <limits>
+
Environment::Environment(PulseData& data) : PulseEnvironmentSystem(data)
{
Clear();
```https://gitlab.kitware.com/physiology/engine/-/issues/34Updated java dependencies2021-09-09T08:51:37-04:00marinierUpdated java dependenciesFor the 4.0 release, there are some minor version updates to some of the java dependencies that would be good to include:
[guava-30.1.1-jre.jar](/uploads/154cbf9c2d3b37dbfeefbf63e82775db/guava-30.1.1-jre.jar)
[gson-2.8.8.jar](/uploads/...For the 4.0 release, there are some minor version updates to some of the java dependencies that would be good to include:
[guava-30.1.1-jre.jar](/uploads/154cbf9c2d3b37dbfeefbf63e82775db/guava-30.1.1-jre.jar)
[gson-2.8.8.jar](/uploads/5311b0390aecbbaf7dc11575ac03cbdc/gson-2.8.8.jar)
[error_prone_annotations-2.5.1.jar](/uploads/4a5c9c2fc32442e42e6134718fc2f08a/error_prone_annotations-2.5.1.jar)
[slf4j-api-1.7.32.jar](/uploads/72a7a21b030d2fc73808789783d267c4/slf4j-api-1.7.32.jar)
[logback-classic-1.2.5.jar](/uploads/5b9638410ce2883e324c17167b62a03a/logback-classic-1.2.5.jar)
[logback-core-1.2.5.jar](/uploads/fbb644e48f4811a42a57efa60b6ca5a9/logback-core-1.2.5.jar)
The rest of the dependencies appear to already be at their latest versions. I haven't had a chance to actually test with these versions, but they are minor changes so I'd be shocked if any of them required any changes to the code.Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/33SEBrainInjury missing setSeverity method2021-07-30T11:15:15-04:00marinierSEBrainInjury missing setSeverity method`SEBrainInjury` has a type and severity, both of which are required to be valid. There is a `setType` method, but no `setSeverity` method.`SEBrainInjury` has a type and severity, both of which are required to be valid. There is a `setType` method, but no `setSeverity` method.Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/32Updated java dependencies2021-05-18T15:20:41-04:00marinierUpdated java dependenciesThere are updated versions of the java dependencies available. I've attached them below -- this is the complete set, to entirely replace the existing set (one or two old dependencies of dependencies went away with newer versions). I have...There are updated versions of the java dependencies available. I've attached them below -- this is the complete set, to entirely replace the existing set (one or two old dependencies of dependencies went away with newer versions). I haven't been able to test in my application because of the issue I reported [here](https://discourse.kitware.com/t/accessing-current-hemorrhage-severity-for-a-compartment/599/8), but at least everything compiles in my application :)
Anyway, I was hoping these might get in for the 3.2.0 release.
[xmlbeans-4.0.0.jar](/uploads/3cd5ac41b424c0cfdaf2fce1babc97f4/xmlbeans-4.0.0.jar)
[commons-collections4-4.4.jar](/uploads/d92e79976231dc07dcfb78adbec20571/commons-collections4-4.4.jar)
[commons-compress-1.20.jar](/uploads/3cf6af4956151de30acbb59354429bed/commons-compress-1.20.jar)
[commons-math3-3.6.1.jar](/uploads/3a8f692a70607690da722f728c9d0fc3/commons-math3-3.6.1.jar)
[error_prone_annotations-2.3.4.jar](/uploads/b5c519003370c50bf1b31ca01c08315d/error_prone_annotations-2.3.4.jar)
[gson-2.8.6.jar](/uploads/c649fe55d4d665ca2decbbd6aea1b0b2/gson-2.8.6.jar)
[guava-30.1-jre.jar](/uploads/d24d9b521212c56485dd48bbed182da0/guava-30.1-jre.jar)
[java-ordered-properties-1.0.4.jar](/uploads/cc81d0647ab9579841939f45de42c3f0/java-ordered-properties-1.0.4.jar)
[javassist-3.26.0-GA.jar](/uploads/ac4579195dbee2481efdba93044cd098/javassist-3.26.0-GA.jar)
[jfreechart-1.5.3.jar](/uploads/f7d5bd85bd3345a80db9139d04d3967d/jfreechart-1.5.3.jar)
[logback-classic-1.2.3.jar](/uploads/6c01616b6691d66840d0147d51cf7a2d/logback-classic-1.2.3.jar)
[logback-core-1.2.3.jar](/uploads/296a03cd751fc1c72617ef3da8c5dc0d/logback-core-1.2.3.jar)
[poi-5.0.0.jar](/uploads/baec3b18d9bfdbdc47adf280f02b9aee/poi-5.0.0.jar)
[poi-ooxml-5.0.0.jar](/uploads/7979339ab097db208bb7126c8bf88b61/poi-ooxml-5.0.0.jar)
[poi-ooxml-lite-5.0.0.jar](/uploads/d5087af9f8ef3e9c23d5593811b71ef3/poi-ooxml-lite-5.0.0.jar)
[reflections-0.9.12.jar](/uploads/2e38dee3e5617a2df9c32d4bf25f5080/reflections-0.9.12.jar)
[slf4j-api-1.7.30.jar](/uploads/60122da5d2dd5765dfb1772cca287bba/slf4j-api-1.7.30.jar)Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/31Feature request: decouple pulse from data directory2021-04-13T08:28:23-04:00marinierFeature request: decouple pulse from data directoryCurrently, Pulse is tightly coupled with its data directory, such that it is difficult to provide external inputs (e.g., a patient from a source not in the data directory). As a library, Pulse would ideally give an application complete f...Currently, Pulse is tightly coupled with its data directory, such that it is difficult to provide external inputs (e.g., a patient from a source not in the data directory). As a library, Pulse would ideally give an application complete freedom to provide these files however it wants. At the same time, it is convenient for Pulse to provide built-in defaults.
For example, consider specifying a patient file to load (this example in Java):
```java
SEPatientConfiguration pc = new SEPatientConfiguration();
pc.setDataRootDir("path/to/datadir");
pc.setPatientFile("patientfile.json");
```
First, it is strange that the path to the data directory needs to be provided to the patient configuration -- this seems like something that should be associated with the Pulse Engine itself as opposed to a specific patient. Perhaps similar to how the native library directory can be specified.
Second, Pulse assumes that `patientfile.json` is in a `patients` subdirectory under the data directory. This is not obvious, as seems like an unnecessary restriction -- the application should be able to provide the absolute path to any patient file it wants, and if a relative path is provided, it should be relative to the current working directory.
Of course, for an easy out-of-the-box experience, it's convenient to be able to assume that everything is relative to a common data directory. So what I suggest is a search scheme:
0. The data directory is specified separately at the engine level. Only the patient file is specified as part of `SEPatientConfiguration`.
1. If the patient file is absolute, load it directly from the specified location.
2. If the patient file is relative, try to load it relative to the current working directory.
3. If that doesn't work, try loading it relative to the data directory.
4. If that doesn't work, try loading it relative to datadirectory/patients. (This is for backwards compatibility.)
This seems to provide a lot of flexibility and has more intuitive behavior (to me, at least) while still ensuring that nearly all existing code will still work. (A possible exception is if there happens to be a patient file with the same name on one of the other paths that is checked.)
If you wanted to take this to the next level, you could allow the user to specify additional search paths.
Patients are not the only issue -- environments, substances, etc. should all behave the same way, in allowing the application to specify where to find them and falling back to the existing behavior as needed. This allows, e.g., the application to add/replace specific files while still using the default data directory for everything else.https://gitlab.kitware.com/physiology/engine/-/issues/30Typo in HowTo_EngineUse.java2021-03-17T22:37:32-04:00marinierTypo in HowTo_EngineUse.javaThis line: https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/howto/HowTo_EngineUse.java#L225
```java
patient_configuration.setPatientFile("./patient/StandardMale.json");
```
has a typo in the path -- "p...This line: https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/howto/HowTo_EngineUse.java#L225
```java
patient_configuration.setPatientFile("./patient/StandardMale.json");
```
has a typo in the path -- "patient" should be "patients".https://gitlab.kitware.com/physiology/engine/-/issues/29Typo in error message when creating a PulseEngine in Java2021-03-17T22:37:41-04:00marinierTypo in error message when creating a PulseEngine in JavaThis line: https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/engine/PulseEngine.java#L146
```java
logListener.error("Unable to initialize enging", ex);
```
has a typo -- "enging" should be "engine".This line: https://gitlab.kitware.com/physiology/engine/-/blob/3.x/src/java/com/kitware/pulse/engine/PulseEngine.java#L146
```java
logListener.error("Unable to initialize enging", ex);
```
has a typo -- "enging" should be "engine".https://gitlab.kitware.com/physiology/engine/-/issues/28JVM crash when advancing time2021-01-04T13:52:08-05:00marinierJVM crash when advancing timeI have a scenario with a massive hemorrhage (intended to mimic a leg amputation) that typically runs for ~2.5 mins before negative volume occurs (this is with pulse 3.1.0 using severity for the hemorrhages).
Specifically, starting at ti...I have a scenario with a massive hemorrhage (intended to mimic a leg amputation) that typically runs for ~2.5 mins before negative volume occurs (this is with pulse 3.1.0 using severity for the hemorrhages).
Specifically, starting at time 0:
* Hemorrhage, external, LeftLeg, Severity=0.2
* Hemorrhage, external, VenaCava, Severity=0.2
* Hemorrhage, external, RightLeg, Severity=0.01
I've run this many times without anything special happening, but today I got a JVM crash: [hs_err_pid17052.log](/uploads/1950e835d55e282dc34992fefa1cdb25/hs_err_pid17052.log)
Not a critical issue for me as apparently it doesn't happen very often.Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/27Add automatic module name entry to MANIFEST.MF in java jar2021-01-04T15:50:16-05:00marinierAdd automatic module name entry to MANIFEST.MF in java jarIn Java 9+, jars are supposed to have module names. If they don't (e.g., a jar built from an earlier version of Java), then Java will assign an automatic module name based on the file name. For pulse, the module name that gets created is...In Java 9+, jars are supposed to have module names. If they don't (e.g., a jar built from an earlier version of Java), then Java will assign an automatic module name based on the file name. For pulse, the module name that gets created is `pulse`. This is bad for at least two reasons:
* The name is considered "unstable" (because the file name could change), which leads to warnings
* It doesn't follow the naming convention. By the [recommended conventions](https://openjdk.java.net/projects/jigsaw/spec/sotms/#module-declarations), the name should be `com.kitware.pulse`.
The module name is normally specified in `module-info.java`, but this is only possible if you are compiling with Java 9+, and if you do that you will not be compatible with Java 8- (you can't just target a version earlier than 9 because of fundamental incompatibilities due to the module system).
Luckily, there is a way to specify what the module name should be for Java 9+ without affecting earlier versions of Java -- you can put it in the MANIFEST.MF file. This then becomes the "automatic" module name, as opposed to something derived from the file name. Java 9+ will look there for this info and use it, and Java 8- will ignore it, so it's the best of both worlds (at least until you're ready to leave Java 8 behind, which I assume is not any time soon).
The manifest file needs an entry like this:
```
Automatic-Module-Name: com.kitware.pulse
```
I manually modified the MANIFEST.MF file in Pulse.jar so it looks like this (I just added the last line):
```
Manifest-Version: 1.0
Created-By: 1.8.0_275 (Private Build)
Automatic-Module-Name: com.kitware.pulse
```
And that works! I'm not a cmake expert, but to get this to happen automatically, it looks like the file `src/java/CMakeLists.txt` needs to be modified in the `add_jar` block starting on line 25. Specifically, a clause like this can be added:
```
MANIFEST /path/to/manifest
```
With a custom manifest file like the one above provided.Aaron Brayaaron.bray@kitware.comAaron Brayaaron.bray@kitware.comhttps://gitlab.kitware.com/physiology/engine/-/issues/25Old jar dependencies causing issues with Java 112020-06-24T12:56:42-04:00Bob MarinierOld jar dependencies causing issues with Java 11Some of the Java jar dependencies are very old, or have very old dependencies packaged with them, which is causing issues in Java 11. Specifically, `reflections-0.9.9-RC1` includes a very old `dom4j`, which includes a very old `xml-apis`...Some of the Java jar dependencies are very old, or have very old dependencies packaged with them, which is causing issues in Java 11. Specifically, `reflections-0.9.9-RC1` includes a very old `dom4j`, which includes a very old `xml-apis`, which has split packages. Split packages are no longer allowed in Java 11. The latest `reflections-0.9.12` no longer has this problem (as it uses newer versions of its dependencies). `poi` and `poi-ooxml` also have much newer versions that increase compatibility with new Java versions. I haven't investigated the rest of the dependencies.
In general, it would be nice if all the dependencies were updated to their newest versions, as that is likely to reduce headaches on new versions of Java.
If it would help, I'm happy to track down the latest versions of everything so you can incorporate them.https://gitlab.kitware.com/physiology/engine/-/issues/24Substance, Nutrition and output result location customizable2020-04-29T10:40:25-04:00Robson Cardoso dos SantosSubstance, Nutrition and output result location customizableI'm using C client in linux command line and, complementing what @marinier said in #20, the files generated during build process dos not complain with FHS Standard for linux, folders like:
* substances
* nutrition
* resource
* stable
* s...I'm using C client in linux command line and, complementing what @marinier said in #20, the files generated during build process dos not complain with FHS Standard for linux, folders like:
* substances
* nutrition
* resource
* stable
* states
should be located in a different folder from the `bin` folder to be able to package this application for certain Linux distributions.
However, for this to be possible, it would be interesting if we could customize the location of the aforementioned folders, perhaps through a json configuration file, a dotfile such as .pulserc or even as arguments passed to the executable, just as it is done with the input scenario file, when using `PulseScenarioDriver`, as well as an option to define the output location of the results.https://gitlab.kitware.com/physiology/engine/-/issues/23Make patient file locations customizable2020-04-29T10:38:58-04:00marinierMake patient file locations customizableCurrently, `PulseEngine::InitializeEngine()` on the C++ side assumes that patient files are located under a `patients` directory. If the file location does not include `/patients` somewhere in it, then it gets prepended.
In my case, my ...Currently, `PulseEngine::InitializeEngine()` on the C++ side assumes that patient files are located under a `patients` directory. If the file location does not include `/patients` somewhere in it, then it gets prepended.
In my case, my Java application is passing the absolute path to the patient file (which is in a custom location), so it looks like this:
`C:/path/to/patient.json`
Since this doesn't have `/patients` in it, it gets mangled to this:
`./patients/C:/path/to/patient.json`
Which doesn't work, so the engine initialization fails. Additionally, it was hard to figure out what had happened because while there are many error checks that print a message when something goes wrong, this one does not, so all I see is:
```
PulseEngine::115::Unable to initialize engine
PulseEngine::154::Engine has died
```
It seems like this part of the code could get the best of both worlds -- try to load the specified location as-is, and if that doesn't work, try pre-pending `./patients/`. And an error message saying what it tried and failed to load would be nice, too :)https://gitlab.kitware.com/physiology/engine/-/issues/22Native library loading in Java is a bit brittle2020-06-23T09:34:30-04:00marinierNative library loading in Java is a bit brittleIn `FileUtils.loadLibrary()`, it searches for the `libName` (i.e., `PulseJNI`) followed by "." or "d.". It then checks to see if exactly 1 file was found by either search. The problem is, this really restricts where the libraries can be....In `FileUtils.loadLibrary()`, it searches for the `libName` (i.e., `PulseJNI`) followed by "." or "d.". It then checks to see if exactly 1 file was found by either search. The problem is, this really restricts where the libraries can be. E.g., I was trying to have all the debug libs in a single directory with their pdb files, but the pdb files cause there to be 2 matches, so then it falls through to the default case, which tries to load the non-debug libs.
I assume the files are being looked for in this particular way to avoid dealing with platform-specific suffixes. Instead of this approach, you could do this: `System.mapLibraryName(libName)` and `System.mapLibraryName(libName + "d")`.
Additionally, I wonder if it would be possible to allow a user to specify whether they want the release or debug libs. If this capability existed, then both versions could be in the same directory (currently, if both are present, it will load the release libs).https://gitlab.kitware.com/physiology/engine/-/issues/21Specifying location of native libs from Java doesn't work2020-06-22T09:31:08-04:00marinierSpecifying location of native libs from Java doesn't work`jniBridge.initialize(path)` allows you to optionally specify the location of the native libs, which I am doing. This works fine. However, a subsequent call to `new PulseEngine()` also calls `jniBridge.initialize()`, but without any argu...`jniBridge.initialize(path)` allows you to optionally specify the location of the native libs, which I am doing. This works fine. However, a subsequent call to `new PulseEngine()` also calls `jniBridge.initialize()`, but without any arguments -- basically, it tries to load the native libs again. In my case, the native libs are not in the default location, and so this second call fails, which causes the application to fail, even though it actually already found the libs in the `jniBridge.initialize(path)` call.https://gitlab.kitware.com/physiology/engine/-/issues/20Make location of substances and compounds customizable2020-04-29T10:40:25-04:00marinierMake location of substances and compounds customizableIn Java, the `SESubstanceManager` class loads the substances and compounds via the `loadSubstanceDirectory()` method. This method hard-codes the path to the `substances` and `compounds` directories as relative to the working directory. T...In Java, the `SESubstanceManager` class loads the substances and compounds via the `loadSubstanceDirectory()` method. This method hard-codes the path to the `substances` and `compounds` directories as relative to the working directory. This method is called internally by Pulse when `PulseEngine.initializeEngine(...)` is called.
The problem is that when deploying a java application, how these directories are packaged with the application may require them to be elsewhere. Additionally, the current working directory cannot be reliably changed from within Java. Changing the `user.dir` system property and even using [jnr-posix](https://github.com/jnr/jnr-posix) to change the directory from the OS side did not work. (I'm using Java 11 64-bit on Windows 10.)
Perhaps a configuration file or additional params to `initializeEngine()` could allow the location to be specified.https://gitlab.kitware.com/physiology/engine/-/issues/19Hemorrhage example2020-07-10T09:41:37-04:00Mattias Lantz CronqvistHemorrhage exampleHello!
I'm trying to run some of the cpp examples and i got stuck on the hemorrhage one. I have tried both the master and 2.0 branches, with the same result. The output from the engine is listed below. Do you have any ideas on what is ha...Hello!
I'm trying to run some of the cpp examples and i got stuck on the hemorrhage one. I have tried both the master and 2.0 branches, with the same result. The output from the engine is listed below. Do you have any ideas on what is happening, am i doing something wrong?
[INFO] : [0(s)] HowToHemorrhage
[INFO] : [0(s)] The patient is nice and healthy
[INFO] : [0(s)] Cardiac Output : 5682.55mL/min
[INFO] : [0(s)] Hemoglobin Content : 853.501g
[INFO] : [0(s)] Blood Volume : 5587mL
[INFO] : [0(s)] Mean Arterial Pressure : 94.663mmHg
[INFO] : [0(s)] Systolic Pressure : 113.721mmHg
[INFO] : [0(s)] Diastolic Pressure : 73.021mmHg
[INFO] : [0(s)] Heart Rate : 73.1707bpm
[INFO] : [0(s)] [Action] 0(s), Patient Action : Hemorrhage
Rate: 250(mL/min)
For Compartment: RightLegVasculature
Type: External
FATAL:Can't transport with a negative volume included. Node = RightLegVasculature. Volume = -0.0337674 mL :
[FATAL] : [27.28(s)] Can't transport with a negative volume included. Node = RightLegVasculature. Volume = -0.0337674 mL