Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
RBEGamer committed Oct 8, 2024
1 parent 8a15a0c commit 14e11bb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/MRP/MRPMagnetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def from_int(_val: int):
try:
return MagnetType(_val)
except:
return None
return MagnetType.NOT_SPECIFIED


def __int__(self):
Expand Down
9 changes: 7 additions & 2 deletions src/MagneticReadoutProcessing/MRP/MRPReading.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ def set_additional_data(self, _k: str, _v: any):
:param _v: Value
:type _v: str
"""
if self.additional_data is None:
self.additional_data = {

}

if _k is not None and len(_k) > 0:
self.additional_data[str(_k)] = _v

Expand Down Expand Up @@ -624,8 +629,8 @@ def dump_to_file(self, _filepath_name: str) -> str:
self.set_additional_data('export_filepath', _filepath_name)
self.set_additional_data('export_filename', os.path.basename(_filepath_name))

if self.additional_data['name'] != 'unknown':
self.set_additional_data('name', os.path.basename(_filepath_name))
if not self.has_additional_data("name"):
self.set_name(os.path.basename(_filepath_name))

# FINALLY EXPORT TO FILE USING THE self.dump option
try:
Expand Down
22 changes: 12 additions & 10 deletions src/MagneticReadoutProcessing/MRP/MRPReadingEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def from_int(_val: int):
try:
return MRPReadingEntryUnit(_val)
except:
return None
return MRPReadingEntryUnit.UNIT_UNSPECIFIED

class MRPReadingEntry:
""" Class holds all values for one read entry such as value and position"""
Expand All @@ -34,7 +34,7 @@ class MRPReadingEntry:


@property
def unit(self):
def unit(self) -> MRPReadingEntryUnit:
return self._unit

@unit.setter
Expand All @@ -43,31 +43,31 @@ def unit(self, value: MRPReadingEntryUnit):


@property
def temperature(self):
def temperature(self) -> float:
return self._temperature

@temperature.setter
def temperature(self, value: float):
self._temperature = value

@property
def value(self):
def value(self) -> float:
return self._value

@value.setter
def value(self, value: float):
self._value = value

@property
def phi(self):
def phi(self) -> float:
return self._phi

@phi.setter
def phi(self, value: float):
self._phi = value

@property
def theta(self):
def theta(self) -> float:
return self._theta

@theta.setter
Expand All @@ -78,31 +78,31 @@ def theta(self, value: float):


@property
def reading_index_phi(self):
def reading_index_phi(self) -> int:
return self._reading_index_phi

@reading_index_phi.setter
def reading_index_phi(self, value: int):
self._reading_index_phi = value

@property
def reading_index_theta(self):
def reading_index_theta(self) -> int:
return self._reading_index_theta

@reading_index_theta.setter
def reading_index_theta(self, value: int):
self._reading_index_theta = value

@property
def is_valid(self):
def is_valid(self) -> bool:
return self._is_valid

@is_valid.setter
def is_valid(self, value: bool):
self._is_valid = value

@property
def id(self):
def id(self) -> int:
return self._id

@id.setter
Expand Down Expand Up @@ -203,5 +203,7 @@ def __dict__(self) -> dict:
'temperature': self._temperature,
'unit': self._unit.value
}


def to_dict(self) -> dict:
return self.__dict__()
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "MagneticReadoutProcessing"
version = "2.0.6"
version = "2.0.7"
description = "This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data."
license = {file = "LICENSE"}
authors = [{name = "Marcel Ochsendorf", email = "[email protected]"}]
Expand Down
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = MagneticReadoutProcessing
version = 2.0.6
version = 2.0.7
author = Marcel Ochsendorf
author_email = [email protected]
description = This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data.
Expand Down
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
install_requires = [str(requirement) for requirement in pkg_resources.parse_requirements(requirements_txt)]

setup(name='MagneticReadoutProcessing',
version='2.0.6',
version='2.0.7',
license='Apache 2',
description='This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data.',
author='Marcel Ochsendorf',
Expand Down

0 comments on commit 14e11bb

Please sign in to comment.