Tracheal CO2/O2 Partial Pressures

I am attempting to get the Tracheal CO2 Partial Pressure value, but can't seem to find an easy way to do this through the SDK. Is there an easy way to get this and similar values?

Comments

  • coolwebbcoolwebb Entry Level
    You should be able to get it through the compartment like this:

    SEAnatomyCompartmentDataRequest* antmyRequest;
    SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide");
    antmyRequest = new SEAnatomyCompartmentDataRequest();
    antmyRequest->Set(CDM::enumAnatomy::Trachea, CDM::enumCompartmentType::Pulmonary, *CO2, "PartialPressure");
  • abrayabray Entry Level
    The example Jeff provided is for creating a Data Request object for an SEScenario.
    When the engine runs that scenario, the trachea CO2 partial pressure will then be provided in the output file.

    If you are wanting to get it directly via the PhysiologyEngineInterface, take a look at the HowTo-EngineUse.cpp file
    I grab the Trachea CO2 Volume, but Partial Pressure is on the same object

    Here are the key points you will need :

    // Let's grab the substance via name from the substance manager, string look ups are slow
    // So it's a good idea to cache this pointer so you can reuse it when asking at various time steps
    // You can find all substances defined in xml files in the substances directory of your working directory
    // Names are in those xml files. ALL substance xml files are loaded into a substance managers when the engine is created
    SESubstance* CO2 = bg->GetSubstanceManager().GetSubstance("CarbonDioxide");

    // Next let's cache off some object pointers we are going to be accessing frequently
    // Using the compartment we can get more detailed respiratory information by grabbing the trachea pulmonary compartment
    const SEAnatomyGasCompartment* trachea = bg->GetAnatomyCompartments()->GetPulmonaryCompartment(CDM::enumAnatomy::Trachea);
    // This is the object that specifically holds the CO2 data associated with the trachea pulmonary data
    const SEGasCompartmentSubstanceQuantity* tCO2 = trachea->GetSubstanceQuantity(*CO2);

    // Now you can set up your engine, and advanced time at least 1 time step, you can start getting data back from the engine

    // And when ever you want the partial pressure, grab it from tCO2
    std::cout << "Trachea CO2 Partial Pressure " << tCO2->GetPartialPressure(SEScalarPressure::cmH2O) << SEScalarPressure::cmH2O << "\n";



    You can read more about the compartment interface here :
    https://www.biogearsengine.com/documentation/_c_d_m.html
    More detailed CDM class documentation is laid out here:
    https://www.biogearsengine.com/documentation/modules.html
    and you can look at the compartment structure here:
    https://www.biogearsengine.com/documentation/group___compartment.html#details

    Also check out the Systems in the modules for all the system data available

    Let us know if you have any troubles!
    Thanks!
    coolwebb
Sign In or Register to comment.