axoden

axoden simplifies the quantification of axonal projections in neuroscience.

axoden.load_table(file_path: str)

Load a table from a csv file.

Parameters:

file_path (str) – Path to the csv file.

Returns:

A DataFrame with the data from the csv file.

Return type:

pd.DataFrame

axoden.plot_signal_intensity_along_axis(project_name: str, df: DataFrame, pixel_size: float)

Plot the signal intensity along the x and y axis of the DataFrame.

Parameters:
  • project_name (str) – Name of the project.

  • df (pd.DataFrame) – DataFrame with the data to plot.

  • pixel_size (float) – Pixel size in micrometers.

Returns:

A figure with the signal intensity along the x and y axis.

Return type:

plt.Figure

axoden.process_folder(folder_path: str, pixel_size: float, is_masked: bool, output_folder: str = None, save: bool = True) Tuple[DataFrame, DataFrame]

Process all images in a folder.

Optionally save the data to csv files and the control plots to pdf files.

Parameters:
  • folder_path (str) – Path to the folder containing the images.

  • pixel_size (float) – Pixel size in micrometers.

  • is_masked (bool) – True if the image was masked and contains regions that are set to a value of 0.

  • output_folder (str) – Path to the folder where the data will be saved. If not set, the input folder will be used.

  • save (bool) – True if the control plots should be saved. Default is True.

Returns:

A tuple containing the data for the images and the data for the axis.

Return type:

Tuple[pd.DataFrame, pd.DataFrame]

axoden.process_image(file_name: any, is_masked: bool, pixel_size: float, animal: str = 'animal1', brain_area: str = 'brain_area1', group: str = 'group1') Tuple[Figure, dict, dict]

Process a single image and generate a control plot.

Parameters:
  • file_name (any) – A filename (string), os.PathLike object or a file object.

  • is_masked (bool) – True if the image was masked and contains regions that are set to a value of 0.

  • pixel_size (float) – Pixel size in micrometers.

  • animal (str) – Name of the animal. Default is “animal1”.

  • brain_area (str) – Name of the brain area. Default is “brain_area1”.

  • group (str) – Name of the group. Default is “group1”.

Returns:

A tuple containing the figure, the data for the image and the data with the axis projections.

Return type:

Tuple[plt.Figure, dict, dict]

axoden.save_table(df: DataFrame, folderpath: str, filename: str)

Save a table to a csv file.

Parameters:
  • df (pd.DataFrame) – DataFrame to save.

  • folderpath (str) – Path to the folder where the file will be saved.

  • filename (str) – Name of the file.

axoden.write_signal_intensity_along_axis_plot(output_folder: str, df: DataFrame, pixel_size: float, project_name: str = None)

Write the signal intensity along the axis to a pdf file in the folder provided.

Parameters:
  • folderpath (str) – Path to the folder where the data will be saved.

  • df (pd.DataFrame) – Dataframe with the axis data to plot.

  • pixel_size (float) – Pixel size in micrometers.

  • project_name (str) – Name of the project. If not set, it will be the name of the output folder.

axoden.write_summary_data_plot(folder_path: str, df_input: DataFrame, project_name: str = None)

Write the summary data plot to a pdf file in the folder provided.

Parameters:
  • folder_path (str) – Path to the folder where the data will be saved.

  • df_input (pd.DataFrame) – Dataframe with the data to plot.

  • project_name (str) – Name of the project. If not set, default to the folder name.