docstr: Calculates the mean squared displacement on the discrete propagator
  
  ..math::
      :nowrap:
          \begin{equation}
              MSD:{DSI}=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} P(\hat{\mathbf{r}}) \cdot \hat{\mathbf{r}}^{2} \ dr_x \ dr_y \ dr_z
          \end{equation}
  
  where $\hat{\mathbf{r}}$ is a point in the 3D Propagator space
  (see Wu et al. [1]_).
  
  Parameters
  ----------
  normalized : boolean, optional
      Whether to normalize the propagator by its sum in order to obtain a
      pdf. Default: True
  
  Returns
  -------
  msd : float
      the mean square displacement
  
  References
  ----------
  .. [1] Wu Y. et al., "Hybrid diffusion imaging", NeuroImage, vol 36,
  p. 617-629, 2007.
docstr_tok: ["Calculates","the","mean","squared","displacement","on","the","discrete","propagator","..","math",":",":",":","nowrap",":","\\begin","{","equation","}","MSD",":","{","DSI","}","=\\int_","{","-\\infty","}","^","{","\\infty","}","\\int_","{","-\\infty","}","^","{","\\infty","}","\\int_","{","-\\infty","}","^","{","\\infty","}","P","(","\\hat","{","\\mathbf","{","r","}","}",")","\\cdot","\\hat","{","\\mathbf","{","r","}","}","^","{","2","}","\\","dr_x","\\","dr_y","\\","dr_z","\\end","{","equation","}","where","$","\\hat","{","\\mathbf","{","r","}","}","$","is","a","point","in","the","3D","Propagator","space","(","see","Wu","et","al",".","[","1","]","_",")",".","Parameters","--","--","--","--","--","normalized",":","boolean",",","optional","Whether","to","normalize","the","propagator","by","its","sum","in","order","to","obtain","a","pdf",".","Default",":","True","Returns","--","--","--","-","msd",":","float","the","mean","square","displacement","References","--","--","--","--","--","..","[","1","]","Wu","Y.","et","al.",",","``","Hybrid","diffusion","imaging","''",",","NeuroImage",",","vol","36",",","p.","617-629",",","2007","."]
code: def msd_discrete(self, normalized=True):
      r"""Calculates the mean squared displacement on the discrete propagator
  
      ..math::
          :nowrap:
              \begin{equation}
                  MSD:{DSI}=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} P(\hat{\mathbf{r}}) \cdot \hat{\mathbf{r}}^{2} \ dr_x \ dr_y \ dr_z
              \end{equation}
  
      where $\hat{\mathbf{r}}$ is a point in the 3D Propagator space
      (see Wu et al. [1]_).
  
      Parameters
      ----------
      normalized : boolean, optional
          Whether to normalize the propagator by its sum in order to obtain a
          pdf. Default: True
  
      Returns
      -------
      msd : float
          the mean square displacement
  
      References
      ----------
      .. [1] Wu Y. et al., "Hybrid diffusion imaging", NeuroImage, vol 36,
      p. 617-629, 2007.
  
      """
  
      Pr = self.pdf(normalized=normalized)
  
      # create the r squared 3D matrix
      gridsize = self.qgrid_sz
      center = gridsize // 2
      a = np.arange(gridsize) - center
      x = np.tile(a, (gridsize, gridsize, 1))
      y = np.tile(a.reshape(gridsize, 1), (gridsize, 1, gridsize))
      z = np.tile(a.reshape(gridsize, 1, 1), (1, gridsize, gridsize))
      r2 = x**2 + y**2 + z**2
  
      msd = np.sum(Pr * r2) / float((gridsize**3))
      return msd
  
imports: import numpy
  from scipy.ndimage import map_coordinates
  from scipy.fftpack import fftn, fftshift, ifftshift
  from dipy.reconst.odf import OdfModel, OdfFit
  from dipy.reconst.cache import Cache
  from dipy.reconst.multi_voxel import multi_voxel_fit
label_desc: Use image node_id 5 for calling the DiffusionSpectrumFit obj's underlying member method code with example usage: obj.msd_discrete(normalized) and returns: msd