Skip to content

Commit

Permalink
fix: wrong handling of number of columns and rows in options
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 committed Oct 28, 2020
1 parent 6173a4b commit dc20285
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/index.js
Expand Up @@ -24,19 +24,18 @@ const smallFilter = [
* @param {Array<Array>} [options.filteredData] - convoluted data, if it is defined the convolution step is skipped
*/
export function findPeaks2DRegion(input, options = {}) {
const {
let {
nStdDev = 3,
kernel = smallFilter,
originalData = convolution.matrix2Array(input),
originalData = convolution.matrix2Array(input).data,
filteredData,
rows: nRows,
cols: nCols,
} = options;

let flatten = convolution.matrix2Array(input);
let inputData = flatten.data;

let nRows = options.rows;
let nCols = options.cols;

if (!nRows || !nCols) {
nRows = flatten.rows;
nCols = flatten.cols;
Expand Down Expand Up @@ -78,9 +77,9 @@ export function findPeaks2DMax(input, options) {
let {
nStdDev = 3,
kernel = smallFilter,
originalData = input,
nRows,
nCols,
originalData = convolution.matrix2Array(input).data,
rows: nRows,
cols: nCols,
filteredData,
} = options;

Expand Down

0 comments on commit dc20285

Please sign in to comment.