imagej / imagej-common

ImageJ core data model
https://imagej.net/libs/imagej-common
BSD 2-Clause "Simplified" License
10 stars 18 forks source link

Data view for Histogram1d #76

Open frauzufall opened 6 years ago

frauzufall commented 6 years ago

It would be great have a data view for Histogram1d objects in order to do something like this:

Histogram1d<FloatType> histogram = ij.op().image().histogram(img);
ij.ui().show(histogram);

Currently this crashes with java.lang.ArrayIndexOutOfBoundsException: 1 at this line because the DefaultDatasetView cannot handle 1D.

ctrueden commented 5 years ago

I just ran into this again.

More generally, we should support display of 1D images (by converting them to a 2D with length 1 in Y). And if it's a Histogram1d specifically, use the PlotService in whatever form it ends up, once that is complete and merged.