Difference in the ft-dipolefitting and ft_inverse_dipolefit

On Fieldtrip git, I found this as an explaination for ft_dipolefitting

function [source] = ft_dipolefitting(cfg, data)

% FT_DIPOLEFITTING perform grid search and non-linear fit with one or multiple
% dipoles and try to find the location where the dipole model is best able
% to explain the measured EEG or MEG topography.
%
% This function will initially scan the whole brain with a single dipole on
% a regular coarse grid, and subsequently start at the most optimal location
% with a non-linear search. Alternatively you can specify the initial
% location of the dipole(s) and the non-linear search will start from there.


function [estimate] = ft_inverse_dipolefit(sourcemodel, sens, headmodel, dat, varargin)

This was the explanation for Inverse Dipole fit,

% FT_INVERSE_DIPOLEFIT performs an equivalent current dipole fit with a single

% or a small number of dipoles to explain an EEG or MEG scalp topography.

%

% Use as

% [estimate] = ft_inverse_dipolefit(sourcemodel, sens, headmodel, dat, ...)

I found the explanation to be too vague, could anyone tell me what is the difference between ft_dipolefitting and ft_inverse_dipolefit? Where does the process of iterative optimization occur? dipole fitting or inverse fitting?

I recommend you post your questions about FieldTrip to the FieldTrip development team.
https://www.fieldtriptoolbox.org/development/issues/

Instead of using fminsearch or fminunc as specifies in the Fieldtrip ft_inverse_dipolefit, can we use other optimizers such as fmincon , fseminf , lsqcurvefit , lsqnonlin? If yes, how can we do it on brainstorm script?

I don't know.
This is a question you should maybe ask the FieldTrip team.