Skip to content

Commit

Permalink
Create kdeplots
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Jan 6, 2023
1 parent 673c80d commit 37b44d1
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 4 deletions.
Binary file modified examples/outgoing/ball.subdiv.2.mt.nearest_neighbour.mnc
Binary file not shown.
Binary file modified examples/outgoing/ball.subdiv.2.mt.tricubic.mnc
Binary file not shown.
Binary file modified examples/outgoing/ball.subdiv.2.mt.trilinear.mnc
Binary file not shown.
Binary file modified examples/outgoing/ball.subdiv.2.np.mnc
Binary file not shown.
Binary file modified examples/outgoing/cube.subdiv.2.mt.nearest_neighbour.mnc
Binary file not shown.
Binary file modified examples/outgoing/cube.subdiv.2.mt.tricubic.mnc
Binary file not shown.
Binary file modified examples/outgoing/cube.subdiv.2.mt.trilinear.mnc
Binary file not shown.
Binary file modified examples/outgoing/cube.subdiv.2.np.mnc
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/outgoing/pyramid.subdiv.2.mt.nearest_neighbour.mnc
Binary file not shown.
Binary file modified examples/outgoing/pyramid.subdiv.2.mt.tricubic.mnc
Binary file not shown.
Binary file modified examples/outgoing/pyramid.subdiv.2.mt.trilinear.mnc
Binary file not shown.
Binary file modified examples/outgoing/pyramid.subdiv.2.np.mnc
Binary file not shown.
Binary file modified examples/outgoing/square_prism.subdiv.2.mt.nearest_neighbour.mnc
Binary file not shown.
Binary file modified examples/outgoing/square_prism.subdiv.2.mt.tricubic.mnc
Binary file not shown.
Binary file modified examples/outgoing/square_prism.subdiv.2.mt.trilinear.mnc
Binary file not shown.
Binary file modified examples/outgoing/square_prism.subdiv.2.np.mnc
Binary file not shown.
15 changes: 11 additions & 4 deletions subdivide/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Callable, Sequence, TypeVar, Generic, Optional

import pandas as pd
import seaborn as sns
from chris_plugin import chris_plugin, PathMapper
from loguru import logger

Expand Down Expand Up @@ -72,10 +73,8 @@ def main(options: Namespace, inputdir: Path, outputdir: Path):
json.dump(summary, out, indent=2)
logger.info('summary written to --> {}', summary_file)

# TODO
# double histograms:
# kron v.s. interpolated total voxel count
# kron v.s. interpolated percent_change
_draw_figures(df, outputdir / 'figures')
logger.info('Created figures.')


class LazyCall(Generic[T], Callable[[], T]):
Expand Down Expand Up @@ -150,3 +149,11 @@ def _report_voldiff(other_path: Path) -> VolDiff:
elapsed = f'{(end_ns - start_ns) / 1e9:.1f}s'
logger.info('counted voxel difference: {} -> {} (took {})', other_path, report_path, elapsed)
return diff


def _draw_figures(df: pd.DataFrame, output_dir: Path):
output_dir.mkdir()
plot = sns.kdeplot(df, x='percent_change', hue='method')
plot.figure.savefig(output_dir / 'kdeplot_percent_change.png')
plot = sns.kdeplot(df, x='total', hue='method')
plot.figure.savefig(output_dir / 'kdeplot_total_voxel_count.png')

0 comments on commit 37b44d1

Please sign in to comment.