ImageFittingStore
Index
Constructors
Properties
Accessors
Methods
- cancelFitting
- clearComponents
- createRegions
- deleteSelectedComponent
- fitImage
- resetBackgroundOffset
- resetFittingState
- setBackgroundOffset
- setComponents
- setIsAutoInitVal
- setIsCancelling
- setIsFitting
- setProgress
- setResultString
- setSelectedComponentIndex
- setSelectedFileId
- setSelectedRegionId
- setSolverType
- toggleBackgroundOffsetFixed
- toggleCreateModelImage
- toggleCreateResidualImage
Constructors
constructor
- Returns ImageFittingStore
Properties
backgroundOffset
Constant background offset.
backgroundOffsetFixed
Indicates whether to fix the background offset when fitting.
components
Stores the initial values and fixed flags for each Gaussian component.
createModelImage
Indicates whether to generate a model image when requesting for fitting.
createResidualImage
Indicates whether to generate a residual image when requesting for fitting.
isAutoInitVal
Indicates whether to auto‑generate initial values when requesting for fitting.
isCancelling
Whether cancel is in progress.
isFitting
Whether a fitting request is currently being processed.
progress
Progress of the current fitting request, from 0 to 1 (multiply by 100 for %).
selectedComponentIndex
Index of the component currently selected in the UI.
selectedFileId
ID of the file currently selected for fitting.
selectedRegionId
ID of the region currently selected for fitting. Set to 0 for the current field of view, or -1 for the full image.
solverType
Solver used for fitting.
Accessors
effectiveFrame
- The frame used for fitting. - Returns FrameStore
fitDisabled
- Whether fitting is disabled due to an invalid file ID, all parameters being fixed, invalid initial values, or fitting in progress. - Returns boolean
fixedParamsNum
- The total number of fixed parameters across all Gaussian parameters. Returns 0 if automatic initial-value generation is enabled. - Returns number
frameOptions
- The available file frame options for selection, including the active file. - Returns OptionProps<string | number>[]
regionOptions
- The available region options including the field of view, entire image, and all closed, non-temporary regions. - Returns { label: string; value: number }[]
solverOptions
- Available fitting solver options shown in the UI. MCholesky is excluded because it is not supported in all GSL versions. - Returns { label: string; value: any }[]
validParams
- Whether all input initial values are valid. Returns true if automatic initial-value generation is enabled. - Returns boolean
staticInstance
- Returns ImageFittingStore
Methods
cancelFitting
- Cancels a fitting request if the progress is incomplete and updates the cancelling status. - Returns void
clearComponents
- Resets settings to defaults. - Returns void
createRegions
- Creates ellipse regions on the selected image based on the fitting results. - Returns Promise<void>
deleteSelectedComponent
- Removes the currently selected component (if more than one remains). - Returns void
fitImage
- Sends a fitting request using the current fitting settings. If automatic initial-value generation is enabled, - NaNvalues and- falseflags are used instead of components. Skips the request if fitting is currently disabled.- Returns void
resetBackgroundOffset
- Resets the background offset to 0. - Returns void
resetFittingState
- Resets the fitting states and progress. - Returns void
setBackgroundOffset
- Sets the constant background offset. - Parameters- offset: number- Offset value (ignored if not finite). 
 - Returns void
setComponents
- Sets the number of components used for fitting. - Parameters- num: number- The number of components. 
 - Returns void
setIsAutoInitVal
- Enables or disables automatic initial‑value generation. - Parameters- isAuto: boolean- True to enable, false to disable. 
 - Returns void
setIsCancelling
- Updates whether cancel is in progress. - Parameters- isCancelling: boolean- True if cancellation has been requested. 
 - Returns void
setIsFitting
- Updates whether a fitting request is currently being processed. - Parameters- isFitting: boolean- True when fitting is in progress. 
 - Returns void
setProgress
- Sets the progress of the current fitting request. - Parameters- progress: number- Progress from 0 to 1 (multiply by 100 for %). 
 - Returns void
setResultString
- Processes the fitting results and stores the formatted result string and log messages. - Parameters- regionId: number- The region ID used for fitting. 
- fovInfo: IRegionInfo- Field of view parameters when fitting was performed on the current FOV. 
- fixedParams: boolean[]- Fixed flags for each fitting parameters. 
- values: IGaussianComponent[]- Values for each Gaussian component. 
- errors: IGaussianComponent[]- Fitting errors for each Gaussian component. 
- offsetValue: number- The background offset. 
- offsetError: number- Fitting error of the background offset. 
- integratedFluxValues: number[]- Integrated flux values for each Gaussian component. 
- integratedFluxErrors: number[]- Errors of the integrated flux values. 
- fittingLog: string- The log message. 
 - Returns void
setSelectedComponentIndex
- Sets the index of the component currently selected in the UI. - Parameters- index: number- The selected component index. 
 - Returns void
setSelectedFileId
- Sets the ID of the file currently selected for fitting. - Parameters- id: number- The file ID. 
 - Returns void
setSelectedRegionId
- Sets the ID of the region currently selected for fitting. - Parameters- id: number- The region ID (0 = current FOV, -1 = full image, positive number = specific region). 
 - Returns void
setSolverType
- Sets the solver used for fitting. - Parameters- type: FittingSolverType- A value from - CARTA.FittingSolverType.
 - Returns void
toggleBackgroundOffsetFixed
- Toggles whether the background offset is fixed during fitting. - Returns void
toggleCreateModelImage
- Toggles whether to generate a model image when requesting for fitting. - Returns void
toggleCreateResidualImage
- Toggles whether to generate a residual image when requesting for fitting. - Returns void
Manages the state and logic for multiple Gaussian image fitting.