Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Doxygen docs missing for subsequent macros #4161

Open
dzenanz opened this issue Aug 18, 2023 · 1 comment
Open

Doxygen docs missing for subsequent macros #4161

dzenanz opened this issue Aug 18, 2023 · 1 comment
Labels
type:Documentation Documentation improvement or change

Comments

@dzenanz
Copy link
Member

dzenanz commented Aug 18, 2023

Docstrings are missing for macros after the first.

Description

This piece of code:
https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4rc01/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.h#L143-L152
produces docstring for SetEnforceConnectivity, but not for GetEnforceConnectivity nor EnforceConnectivityOn. Entry for EnforceConnectivityOff is missing entirely from the doc page:
https://itk.org/Doxygen/html/classitk_1_1SLICImageFilter.html

Expected information

Same docstring appears for all of the methods mentioned above.

@albert-github
Copy link
Contributor

We have here 2 problems:

Entry EnforceConnectivityOff not shown at all
This has been identified in #5193 and has been fixed by means of #5195

No group documentation
This should be automatically done by means of the INPUT_FILTER: ITK/Utilities/Doxygen/itkgroup.py (previously ITK/Utilities/Doxygen/itkgroup.pl) as, as far as I understand, the clang format does not like some kind of empty lines / usage of @{ ... @} / \{ ... \}. When running the INPUT_FILTER over the file ITK/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.h the filter doesn't change / add anything (neither with the perl nor python script).
So this explains the missing documentation.

Looking at the mentioned part it looks like:

  /** \brief Post processing step to enforce superpixel morphology.
   *
   * Enable an additional computation which ensures all label pixels of
   * the same value are spatially connected. Disconnected labeled components are
   * assigned a new value if of sufficient size, or are relabeled to
   * the previously encountered value if small.
   */
  itkSetMacro(EnforceConnectivity, bool);
  itkGetMacro(EnforceConnectivity, bool);
  itkBooleanMacro(EnforceConnectivity);

In my opinion:
It will be quite hard to fix the INPUT_FILTER script (needs quite a bit of knowledge about the C++ language and the nesting levels etc.).
It would be better to explicitly add the grouping commands at the relevant places and abandon the INPUT_FILTER. This can be either in the for like @{ ... @} or \{ ... \} so:

  /** \brief Post processing step to enforce superpixel morphology.
   *
   * Enable an additional computation which ensures all label pixels of
   * the same value are spatially connected. Disconnected labeled components are
   * assigned a new value if of sufficient size, or are relabeled to
   * the previously encountered value if small.
   * \{
   */
  itkSetMacro(EnforceConnectivity, bool);
  itkGetMacro(EnforceConnectivity, bool);
  itkBooleanMacro(EnforceConnectivity);
  /** \} */

or by means of an ALIASES (when clang-format doesn't like the @{ ... @} nor \{ ... \} part:

ALIASES += itkGroupStart=@{
ALIASES += itkGroupEnd=@}

resulting in code:

  /** \brief Post processing step to enforce superpixel morphology.
   *
   * Enable an additional computation which ensures all label pixels of
   * the same value are spatially connected. Disconnected labeled components are
   * assigned a new value if of sufficient size, or are relabeled to
   * the previously encountered value if small.
   * \itkGroupStart
   */
  itkSetMacro(EnforceConnectivity, bool);
  itkGetMacro(EnforceConnectivity, bool);
  itkBooleanMacro(EnforceConnectivity);
  /** \itkGroupEnd */

(I personally prefer the explicit @{ ... @} / \{ ... \} version).

Note: I think that running doxygen with -d preprocessor once with and once without the filter might help to identify where currently @{ ... @} is inserted so these files can be inspected (will be quite a bit of work though).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type:Documentation Documentation improvement or change
Projects
None yet
Development

No branches or pull requests

2 participants