Skip to content

Commit

Permalink
fix: spectra zones detection should be only on FT 2D spectra
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Jun 26, 2023
1 parent eee03ca commit 293d2fb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/component/reducer/actions/ZonesActions.ts
@@ -1,4 +1,4 @@
import { FromTo, NmrData2DFid, NmrData2DFt } from 'cheminfo-types';
import { FromTo, NmrData2DFt } from 'cheminfo-types';
import { Draft, original } from 'immer';
import lodashCloneDeep from 'lodash/cloneDeep';
import { setPathLength } from 'nmr-correlation';
Expand Down Expand Up @@ -172,10 +172,8 @@ function handleAutoZonesDetection(
function handleAutoSpectraZonesDetection(draft: Draft<State>) {
for (const datum of draft.data) {
const { info, data } = datum;
if (info.dimension === 2) {
const { minX, maxX, minY, maxY } = info.isFid
? (data as NmrData2DFid).re
: (data as NmrData2DFt).rr;
if (info.dimension === 2 && info.isFt) {
const { minX, maxX, minY, maxY } = (data as NmrData2DFt).rr;
const detectionOptions = {
selectedZone: { fromX: minX, toX: maxX, fromY: minY, toY: maxY },
thresholdFactor: 1,
Expand Down

0 comments on commit 293d2fb

Please sign in to comment.