cheminfo / nmrium

React component to display and process nuclear magnetic resonance (NMR) spectra.
https://docs.nmrium.org
MIT License
55 stars 25 forks source link

2D and re / im vs rr, ri, ir and ii #1943

Closed lpatiny closed 1 year ago

lpatiny commented 1 year ago

2D NMR before and after FID is quite different from 1D.

In 2D before ft we have only re and im while after FT we have rr, ri, ir and ii.

Because currently there is not yet the processing of 2D there was a quick hack to deal with this issue: https://github.com/cheminfo/nmrium/commit/b0ce941eeb1aa656f09fb2e7ce73c124ac16199f

However I think we should have 2 different types:

Datum2DFid

Datum2DFT

A Datum2DFid will be displayed as an image (already done) while a Datum2DFT will be a contour plot.

jobo322 commented 1 year ago

I'm agree to have two different contents. In that way we will have not problems with exportation/importation of files

lpatiny commented 1 year ago

In order to prevent any hacks it is better to have a base type: 'Datum2D'

This type is extended depending 'isFid' to

Datum2DFid Datum2DFT

jobo322 commented 1 year ago

At the moment all function related with 2D spectra are looking for rr quadrant or an object like { z: number[][], minX, ...}.

I think we should keep in state which quadrant or re/im is displayed, then function like detectionZones could use this information to pass the right data to nmr-processing.

jobo322 commented 1 year ago

it was done by https://github.com/cheminfo/nmrium/commit/f0a9471ce568766d5aad0507b4dc4ce77fe6bab8