Browse Source

added descriptions for parmeters to output file

master
Holger Frey 6 years ago
parent
commit
59bb62ea7a
  1. 2
      ideas.md
  2. 7
      mtor/dataproc.py
  3. 13
      mtor/parameters.py

2
ideas.md

@ -1,4 +1,4 @@
Furhter Ideas: Further Ideas:
- color the roi - color the roi
- create a movie - create a movie

7
mtor/dataproc.py

@ -382,6 +382,13 @@ def save_data(data_frame, selected_df, extremas_df, parameters):
k: [v] for k, v in parameters.items() if k not in ignore_parameters k: [v] for k, v in parameters.items() if k not in ignore_parameters
} }
tmp_setings_df = pandas.DataFrame(tmp_parameters).T tmp_setings_df = pandas.DataFrame(tmp_parameters).T
all_descriptions = parameters.get_descriptions()
matched_descritions = {
key: value
for key, value in all_descriptions.items()
if key in tmp_parameters
}
tmp_setings_df["Descriptions"] = pandas.Series(matched_descritions)
tmp_setings_df.to_excel(writer, sheet_name="parameters") tmp_setings_df.to_excel(writer, sheet_name="parameters")
writer.save() writer.save()

13
mtor/parameters.py

@ -8,7 +8,7 @@ from .commons import RE_DIGITS, OUTPUT_FOLDER_NAMES, TifImage
class Parameters(dict): class Parameters(dict):
""" namespacing the parameters for a analysis with nice access """ namespacing the parameters for a analysis with nice access
the following parameters are used: parmeters used for analysing the images
boost: linear factor for brightness on color coded images boost: linear factor for brightness on color coded images
charts_y_limit: common scale for the y axis in graphs charts_y_limit: common scale for the y axis in graphs
@ -42,7 +42,7 @@ class Parameters(dict):
right_guard_column: name of the most used left guard value column right_guard_column: name of the most used left guard value column
right_guard_name: right guard value group name right_guard_name: right guard value group name
roi_bottom: bottom edge of the ROI roi_bottom: bottom edge of the ROI
roi_column: roi_column: name for the ROI
roi_left: bottom left of the ROI roi_left: bottom left of the ROI
roi_name: roi value group name roi_name: roi value group name
roi_right: bottom right of the ROI roi_right: bottom right of the ROI
@ -177,3 +177,12 @@ class Parameters(dict):
self.cut_bottom = max(0, bottom + self.cut_pad_y) self.cut_bottom = max(0, bottom + self.cut_pad_y)
self.cut_right = min(self.image_width, right + self.cut_pad_x) self.cut_right = min(self.image_width, right + self.cut_pad_x)
self.cut_left = max(0, left - self.cut_pad_x) self.cut_left = max(0, left - self.cut_pad_x)
def get_descriptions(self):
docs = type(self).__doc__
lines = (line.strip() for line in docs.split("\n"))
has_colon = (line for line in lines if ":" in line)
pairs = (line.split(":") for line in has_colon)
pairs_cleanup = ((k.strip(), v.strip()) for k, v in pairs)
non_empty = ((k, v) for k, v in pairs_cleanup if k and v)
return dict(non_empty)

Loading…
Cancel
Save