Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 24399934 authored by NADAL Morgane's avatar NADAL Morgane
Browse files

possibility to choose the boundaries for the histograms

parent 67980fc4
No related branches found
No related tags found
No related merge requests found
......@@ -98,9 +98,11 @@ method = None
hist_min_length = None
hist_step_length = None
number_of_bins_length = None
hist_bins_borders_length = None
hist_min_curvature = None
hist_step_curvature = None
number_of_bins_curvature = None
hist_bins_borders_curvature = None
with_plot = None
in_parallel = None
......@@ -126,7 +128,7 @@ image = in_.ImageVerification(image, channel)
# iv_.image_verification(image, channel) # -> PySide2 user interface # TODO: must return the modified image!
# /!\ conflicts between some versions of PySide2 and Python3
# image = image[:, 512:, 512:] # 512 # 562 # Just for development
# image = image[:, 800:, 800:] # 512 # 562 # Just for development
img_shape = image.shape
#
......@@ -405,12 +407,21 @@ elapsed_time = tm_.gmtime(tm_.time() - start_time)
# Extract features
print('\n--- Features Extraction\n')
# Prms
number_of_bins_length = int(number_of_bins_length)
bins_length = np_.linspace(hist_min_length, hist_min_length + hist_step_length * number_of_bins_length, num=number_of_bins_length)
bins_length[-1] = np_.inf
number_of_bins_curvature = int(number_of_bins_curvature)
bins_curvature = np_.linspace(hist_min_curvature, hist_min_curvature + hist_step_curvature * number_of_bins_curvature, num=number_of_bins_curvature)
bins_curvature[-1] = np_.inf
if hist_bins_borders_length is None:
number_of_bins_length = int(number_of_bins_length)
bins_length = np_.linspace(hist_min_length, hist_min_length + hist_step_length * number_of_bins_length, num=number_of_bins_length)
bins_length[-1] = np_.inf
else:
bins_length = np_.array(hist_bins_borders_length)
bins_length[-1] = np_.inf
if hist_bins_borders_curvature is None:
number_of_bins_curvature = int(number_of_bins_curvature)
bins_curvature = np_.linspace(hist_min_curvature, hist_min_curvature + hist_step_curvature * number_of_bins_curvature, num=number_of_bins_curvature)
bins_curvature[-1] = np_.inf
else:
bins_curvature = np_.array(hist_bins_borders_curvature)
bins_curvature[-1] = np_.inf
# DF creation
features_df = ge_.ExtractFeaturesInDF(somas, size_voxel_in_micron, bins_length, bins_curvature, ext_scales)
......
......@@ -96,19 +96,31 @@ method : c
[Features Extraction]
; histograms of extensions lengths
hist_min_length : 0
hist_min_length
#: 0
; in micron
; by default, 0
hist_step_length : 6
hist_step_length
#: 6
; in micron
number_of_bins_length : 5
number_of_bins_length
#: 5
; by default, 5
; extensions generally do not exceed 30 microns
; if the above parameters are set to None, you can directly use the boundaries of your choice for the histogram:
hist_bins_borders_length : (0, 0.5, 1, 5, 10, 50)
; histograms of extensions curvatures
hist_min_curvature : 0
hist_step_curvature : 6
number_of_bins_curvature : 5
hist_min_curvature
#: 0
hist_step_curvature
#: 6
number_of_bins_curvature
#: 5
; if the above parameters are set to None, you can directly use the boundaries of your choice for the histogram:
hist_bins_borders_curvature : (0, 0.05, 0.3, 1, 10, 50)
[Program Running]
......
......@@ -83,9 +83,11 @@ method = parameters['Frangi']['method']
hist_min_length = IfNotFloat('Features Extraction', 'hist_min_length')
hist_step_length = IfNotFloat('Features Extraction', 'hist_step_length')
number_of_bins_length = IfNotFloat('Features Extraction', 'number_of_bins_length')
hist_bins_borders_length = IfNotFloat('Features Extraction', 'hist_bins_borders_length')
hist_min_curvature = IfNotFloat('Features Extraction', 'hist_min_curvature')
hist_step_curvature = IfNotFloat('Features Extraction', 'hist_step_curvature')
number_of_bins_curvature = IfNotFloat('Features Extraction', 'number_of_bins_curvature')
hist_bins_borders_curvature = IfNotFloat('Features Extraction', 'hist_bins_borders_curvature')
# [Program running]
with_plot = parameters.getboolean('Program Running', 'with_plot')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment