Closed MyleneSimon closed 6 years ago
Thanks for the report. Ran out of time today to investigate, but I'll try to reproduce tomorrow.
Copying my reply from the imagej forum:
Based on the stacktrace that you shared, Gauss.java:313
acquires an ImgFactory
(more specifically a SCIFIOCellImgFactory
in the failing case) from your input and passes it to the constructor of GaussFloat
which in turn calls the super constructor AbstractGauss
. The exception message states that setReader
needs to be called before invoking create()
. This means that you cannot call Gauss.inFloatInPlace
with an Img
that produces a SCIFIOCellImgFactory
.
Instead, I suggest you use Gauss3.gauss( double sigma, RandomAccessible< S > source, RandomAccessibleInterval< T > target )
. Here, you will need to
Views.extend...
to make sure that the source is defined where necessary, andArrayImgs.doubles
.example usage (based off your code/variables):
final Img< T > image = (Img<T>) imgOpener.openImg( path, config );
RandomAccessible< T > source = Views.extendMirrorSingle( image );
RandomAccessibleInterval< DoubleType > target = ArrayImgs.doubles( Intervals.dimensionsAsLongArray( image ) );
Gauss3.gauss( sigma, source, target );
Update: The @Deprecated
tag in the Gauss
class also supports my suggestion to use Gauss3
instead.
I am going to close this because this is not an issue with imglib2-algorithm.
Hi,
I am trying to write some simple code to try out imglib2, basically opening an image, process it using one of the algorithms and save it. When I want to open the image as a CellImg, I then get the following error when I call one of the Gauss or Thresholder for example:
Here is the code producing the error:
Am I missing something? If I don't put the
SCIFIOConfig
when opening the image, it is opened as anArrayImg
and I don't get any error.Thanks!