myExpRoutines.m

This package allows to efficently export solutions.

Most of the information is stored using .h5 files, which are a type of binary file that can store large amounts of numerical data. The data is stored in a hierarchical format, similar to a file system. This allows for easy organization and retrieval of data. See fast python plotting package for more information.


Warning

The following description is partially AI generated, it might be incomplete or incorrect.

myExport[file]()

Exports the specified file to the directory of the current notebook.

Parameters:

file (Any Mathematica expression that Export can handle.) – The file to be exported.

Returns:

None

Usage Example:

myExport["data.txt"]
exportACEfields[exportDataPath, meshPath, allkeys, fields, attr]()

Exports a sequence of data fields from a simulation to CSV or HDF5 files.

Parameters:
  • exportDataPath (String) – The directory where the exported data will be saved.

  • meshPath (String) – The directory containing the mesh data.

  • allkeys (List) – List of keys representing simulation steps.

  • fields (List of Strings) – List of fields to export.

  • attr (Association) – Attributes to include in the exported file names.

Returns:

None

Usage Example:

exportACEfields["/path/to/export", "/path/to/mesh", keys, {"field1", "field2"}, <|"Attr" -> "Value"|>]
exportPatientData[jsonPath, extraFieldsComputedInNB, postDir]()

Exports patient data to a specified directory, integrating additional computed fields.

Parameters:
  • jsonPath (String) – Path to the JSON file containing patient data.

  • extraFieldsComputedInNB (Association) – Additional fields computed within the notebook.

  • postDir (String) – The directory where the data will be exported.

Returns:

Updated patient data as an association.

Return type:

Association

Usage Example:

exportPatientData["/path/to/json", <|"Field1" -> value1|>, "/path/to/export"]
extractPlaqueBounds[wallNodes, fibrNodes, calcNodes, lrncNodes, nodes]()

Extracts the bounding box coordinates of the plaque based on the provided node sets.

Parameters:
  • wallNodes (List of Integers) – List of wall node indices.

  • fibrNodes (List of Integers) – List of fibrin node indices.

  • calcNodes (List of Integers) – List of calcification node indices.

  • lrncNodes (List of Integers) – List of lipid-rich necrotic core (LRNC) node indices.

  • nodes (List of Lists) – List of all node coordinates.

Returns:

A dictionary with bounding box coordinates in X, Y, and Z directions.

Return type:

Association

Usage Example:

..​⬤

extractPlaqueNodes[plaqueBounds, wallNodes, fibrNodes, calcNodes, lrncNodes, nodes]()

Identifies the nodes that fall within the plaque region as defined by the bounding box.

Parameters:
  • plaqueBounds (Association) – Bounding box of the plaque.

  • wallNodes (List of Integers) – List of wall node indices.

  • fibrNodes (List of Integers) – List of fibrin node indices.

  • calcNodes (List of Integers) – List of calcification node indices.

  • lrncNodes (List of Integers) – List of lipid-rich necrotic core (LRNC) node indices.

  • nodes (List of Lists) – List of all node coordinates.

Returns:

Lists of node indices for each component within the plaque region.

Return type:

List of Lists

Usage Example:

extractPlaqueNodes[plaqueBounds, wallNodes, fibrNodes, calcNodes, lrncNodes, nodes]
separateNodes[elemNodes, elementMaterialRatios]()

Separates the nodes into different material categories based on the material ratios.

Parameters:
  • elemNodes (List of Lists) – List of nodes for each element.

  • elementMaterialRatios (List of Associations) – List of material ratios for each element.

Returns:

Lists of nodes separated by material type.

Return type:

List of Lists

Usage Example:

separateNodes[elementNodes, elementMaterialRatios]
separateElements[elements, elementMaterialRatios]()

Separates the elements into different material categories based on the material ratios.

Parameters:
  • elements (List of Integers) – List of element indices.

  • elementMaterialRatios (List of Associations) – List of material ratios for each element.

Returns:

Lists of elements separated by material type.

Return type:

List of Lists

Usage Example:

separateElements[elements, elementMaterialRatios]
computeVolumes[elementVol, elementMaterialRatios]()

Computes the volume of different material components within the elements.

Parameters:
  • elementVol (List of Numbers) – List of volumes for each element.

  • elementMaterialRatios (List of Associations) – List of material ratios for each element.

Returns:

Volumes of wall, fibrin, calcification, and LRNC components.

Return type:

List of Numbers

Usage Example:

computeVolumes[elementVol, elementMaterialRatios]