-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OE37 - vtk loading error due to CV and Divergence (#227)
* vtk load restored by stopping CV calc with vtk * OE38-BUG: signalMaps index error (#228) * added index error to signal maps import * added index error to signal maps import * handle empty ablation (#229) * SM7: Read lon file (#1) (#231) * created arrows class to store lines + vector visuals * read lon to obtain fibres data * write lon and elem files * check linear connections and arrows exist before exporting * create empty arrows class if arrows not provided * export vtx files per pacing site * Feature/SM-31: IGB data load (#2) * load igb data * added load igb to imports * fibres filled with dummy values * fibres filled with dummy values * fibres filled with dummy values * Feature/SM-45: Write to CSV (#3) * export CSV writing to file using Panda * Bugfix/SM-63 Empty signalmaps (#4) * load empty signalMaps * Feature/SM-18: Linear connections writer (#5) * openCARP reader saves linear connection regions as separate data structure * faster write function for openCARP data * Feature/SM-45: Export CSV cell and histogram regions (#6) * include histogram and cell region in csv export * Bugfix/SM-86: Free boundaries as one actor (#8) * combine free boundaries into a single actor * not add rf to export openep if ablation == None (#9)
- Loading branch information
1 parent
767a0e3
commit d225828
Showing
9 changed files
with
382 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
from attr import attrs | ||
import numpy as np | ||
|
||
__all__ = [] | ||
|
||
|
||
@attrs(auto_attribs=True, auto_detect=True) | ||
class Arrows: | ||
""" | ||
Class for storing information about arrows and lines on surface | ||
Args: | ||
fibres (np.ndarray): array of shape N_cells x 3 | ||
divergence (np.ndarray): array of shape N_cells x 3 | ||
linear_connections (np.ndarray): array of shape M x 3 (represents the linear connections between endo and epi) | ||
linear_connection_regions (np.ndarray): array of shape N_cells | ||
""" | ||
|
||
# TODO: move divergence arrows into Arrows class | ||
# TODO: remove longitudinal and transversal arrows from Fields class | ||
fibres: np.ndarray = None | ||
divergence: np.ndarray = None | ||
linear_connections: np.ndarray = None | ||
linear_connection_regions: np.ndarray = None | ||
|
||
def __repr__(self): | ||
return f"arrows: {tuple(self.__dict__.keys())}" | ||
|
||
def __getitem__(self, arrow): | ||
try: | ||
return self.__dict__[arrow] | ||
except KeyError: | ||
raise ValueError(f"There is no arrow '{arrow}'.") | ||
|
||
def __setitem__(self, arrow, value): | ||
if arrow not in self.__dict__.keys(): | ||
raise ValueError(f"'{arrow}' is not a valid arrow name.") | ||
self.__dict__[arrow] = value | ||
|
||
def __iter__(self): | ||
return iter(self.__dict__.keys()) | ||
|
||
def __contains__(self, arrow): | ||
return arrow in self.__dict__.keys() | ||
|
||
@property | ||
def linear_connection_regions_names(self): | ||
if self.linear_connection_regions is None: | ||
return [] | ||
regions = np.unique(self.linear_connection_regions).astype(str) | ||
return regions.tolist() | ||
|
||
def copy(self): | ||
"""Create a deep copy of Arrows""" | ||
|
||
arrows = Arrows() | ||
for arrow in self: | ||
if self[arrow] is None: | ||
continue | ||
arrows[arrow] = np.array(self[arrow]) | ||
|
||
return arrows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.