# Problem with new version of Pulse when Deserialising Patient

**URL:** <https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277>\
**Category:** Pulse Physiology Engine\
**Created:** [April 17, 2024, 2:03pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277 "2024-04-17T14:03:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 17, 2024, 2:03pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/1 "2024-04-17T14:03:17Z")

</div>

Hey,  
So in a Vanilla Project, we are trying to call the SerializeFromFile and passing in the StandardMale@0s.json File.

I keep Getting this error that stops it from serialising anymore. Used to work fine in the Older Version. Im using Pulse 4.2

```auto
LogPulse: Warning: [INFO] [0(s)] [SerializingFromFile] ../../../../../I3NucleusPOC/UE_POC/Content/states/StandardMale@0s.json
LogPulse: Warning: [INFO] [0(s)] Human Adult Whole Body
LogPulse: Warning: [INFO] [0(s)] Version : 4.2.0
LogPulse: Warning: [INFO] [0(s)] GitHash : 
LogPulse: Warning: [INFO] [0(s)] Build Time : Wed Apr 17 19:28:54 2024
LogPulse: Warning: [WARN] [0(s)] Protobuf could not SerializeFromString: INVALID_ARGUMENT: invalid JSON in pulse.engine.bind.StateData @ Cardiovascular: message pulse.engine.bind.CardiovascularData, near 802:36 (offset 13789): no such field: 'CardiacCyclePerfusionVolume_mL'

```

Funny thing is. This Key Exists in the JSON

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [April 17, 2024, 2:08pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/2 "2024-04-17T14:08:25Z")

</div>

Pulse does not know what to do with that key in the JSON, it is no longer part of the [Pulse data model](https://gitlab.kitware.com/physiology/engine/-/blob/stable/src/schema/pulse/engine/bind/Physiology.proto?ref_type=heads) in the build you are trying to load

Each of these variables are associated with the mathmatics of the model implementation.  
As we improve models, the math and variables can change

You will need to replace the StandardMale@0s.json file with one generated from the build associated with the Pulse binary you are using

---

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 17, 2024, 2:09pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/3 "2024-04-17T14:09:47Z")

</div>

Oh Thanks. If im building from source where can i find the file ?

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [April 17, 2024, 2:11pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/4 "2024-04-17T14:11:00Z")

</div>

`install/bin/states`

---

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 17, 2024, 2:12pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/5 "2024-04-17T14:12:37Z")

</div>

![image](https://discourse.kitware.com/uploads/default/original/1X/e387b70dc660ff38aba802033c2efeb21fdb1673.png)  
Dont seem to have that folder

My CMake Configuration when building  
 ![image](https://discourse.kitware.com/uploads/default/original/1X/4f1bef20d4f8a98ac936f2cac96677d012d77e1e.png)

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [April 17, 2024, 2:14pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/6 "2024-04-17T14:14:53Z")

</div>

It should have been generated via the build, but you can manually generate them by running the `genData` and `genStates` options via our [development/testing scripts](https://gitlab.kitware.com/physiology/engine/-/wikis/Test%20Suite)

---

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 17, 2024, 2:17pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/7 "2024-04-17T14:17:30Z")

</div>

```auto

D:\I3NucleusPOC\PulseSrc\EngineBuild\install\bin>run genData

D:\I3NucleusPOC\PulseSrc\EngineBuild\install\bin>cmake -DTYPE:STRING=genData -DARG1:STRING= -DARG2:STRING= -P run.cmake
Error: Could not find or load main class com.kitware.pulse.dataset.DataSetReader
Error: Could not find or load main class com.kitware.pulse.dataset.ValidationDataSetReader
Traceback (most recent call last):
  File "D:\I3NucleusPOC\PulseSrc\EngineBuild\install\python\pulse\dataset\generate_data.py", line 4, in <module>
    from pulse.dataset.segment_validation_pipeline import *
  File "D:\I3NucleusPOC\PulseSrc\EngineBuild\install\python\pulse\dataset\segment_validation_pipeline.py", line 9, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

D:\I3NucleusPOC\PulseSrc\EngineBuild\install\bin>run genStates

D:\I3NucleusPOC\PulseSrc\EngineBuild\install\bin>cmake -DTYPE:STRING=genStates -DARG1:STRING= -DARG2:STRING= -P run.cmake
Error: Could not find or load main class com.kitware.pulse.cdm.testing.SETestDriver

D:\I3NucleusPOC\PulseSrc\EngineBuild\install\bin>

```

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [April 17, 2024, 2:20pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/8 "2024-04-17T14:20:28Z")

</div>

To use these tools, you need to build with Java and Python enabled

---

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 17, 2024, 2:20pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/9 "2024-04-17T14:20:50Z")

</div>

Ah ok thanks.

---

<div class="post-metadata">

**Author:** ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)\
**Post date:** [April 18, 2024, 7:54pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/10 "2024-04-18T19:54:07Z")

</div>

I followed all the steps provided on the site and as you guided me.  
genData runs properly but genStates Fails I’ve provided the error message below

```auto
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc78966b12, pid=28248, tid=0x0000000000007b10
#
# JRE version: OpenJDK Runtime Environment (8.0_412-b08) (build 1.8.0_412-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.412-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [Pulse.dll+0xc6b12]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

```

The rest is just memory addresses .

We tried using the Json file provided in the latest pulse explorer.  
When loading the file it still has parameters it does not know what to do with

```auto
LogPulse: Warning: [INFO] [0(s)] [SerializingFromFile] ../../../../../I3NucleusPOC/UE_POC/Content/states/StandardMale@0s.json
LogPulse: Warning: [INFO] [0(s)] Human Adult Whole Body
LogPulse: Warning: [INFO] [0(s)] Version : 4.2.0
LogPulse: Warning: [INFO] [0(s)] GitHash : 
LogPulse: Warning: [INFO] [0(s)] Build Time : Fri Apr 19 01:22:58 2024
LogPulse: Warning: [WARN] [0(s)] Protobuf could not SerializeFromString: INVALID_ARGUMENT: invalid JSON in pulse.engine.bind.StateData @ Respiratory: message pulse.engine.bind.RespiratoryData, near 1738:38 (offset 31088): no such field: 'LeftTopBreathAcinar

```

---

<div class="post-metadata">

**Author:** ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)\
**Post date:** [April 18, 2024, 8:08pm UTC](https://discourse.kitware.com/t/problem-with-new-version-of-pulse-when-deserialising-patient/1277/11 "2024-04-18T20:08:26Z")

</div>

See if you can run `install\bin>PulseScenarioDriver.exe InitialPatientState.json`
