docstr: Return column definitions for all measurements
docstr_tok: ["Return","column","definitions","for","all","measurements"]
code: def get_measurement_columns(self, pipeline, return_sources=False):
      """Return column definitions for all measurements"""
      columns = []
      sources = []
      for image_group in self.image_groups:
          selected_images = self.images_to_process(
              image_group, None, pipeline
          )
          # Image scalings
          if image_group.include_image_scalings.value:
              for image_name in selected_images:
                  columns.append(
                      (
                          "Image",
                          "{}_{}_{}".format(
                              C_IMAGE_QUALITY,
                              C_SCALING,
                              image_name,
                          ),
                          COLTYPE_FLOAT,
                      )
                  )
                  sources.append(
                      [image_group.include_image_scalings, image_name]
                  )
  
          # Blur measurements
          if image_group.check_blur.value:
              for image_name in selected_images:
                  columns.append(
                      (
                          "Image",
                          "{}_{}_{}".format(
                              C_IMAGE_QUALITY, F_FOCUS_SCORE, image_name
                          ),
                          COLTYPE_FLOAT,
                      )
                  )
                  sources.append([image_group.check_blur, image_name])
  
                  columns.append(
                      (
                          "Image",
                          "{}_{}_{}".format(
                              C_IMAGE_QUALITY,
                              F_POWER_SPECTRUM_SLOPE,
                              image_name,
                          ),
                          COLTYPE_FLOAT,
                      )
                  )
                  sources.append([image_group.check_blur, image_name])
  
                  for scale_group in image_group.scale_groups:
                      columns.append(
                          (
                              "Image",
                              "{}_{}_{}_{:d}".format(
                                  C_IMAGE_QUALITY,
                                  F_LOCAL_FOCUS_SCORE,
                                  image_name,
                                  scale_group.scale.value,
                              ),
                              COLTYPE_FLOAT,
                          )
                      )
                      sources.append([scale_group.scale, image_name])
  
                      columns.append(
                          (
                              "Image",
                              "{}_{}_{}_{:d}".format(
                                  C_IMAGE_QUALITY,
                                  F_CORRELATION,
                                  image_name,
                                  scale_group.scale.value,
                              ),
                              COLTYPE_FLOAT,
                          )
                      )
                      sources.append([scale_group.scale, image_name])
  
          # Intensity measurements
          if image_group.check_intensity.value:
              for image_name in selected_images:
                  area_measurement = [
                      F_TOTAL_VOLUME
                      if pipeline.volumetric()
                      else F_TOTAL_AREA
                  ]
                  for feature in area_measurement + INTENSITY_FEATURES:
                      measurement_name = image_name
                      columns.append(
                          (
                              "Image",
                              "{}_{}_{}".format(
                                  C_IMAGE_QUALITY,
                                  feature,
                                  measurement_name,
                              ),
                              COLTYPE_FLOAT,
                          )
                      )
                      sources.append(
                          [image_group.check_intensity, image_name]
                      )
  
          # Saturation measurements
          if image_group.check_saturation.value:
              for image_name in selected_images:
                  for feature in SATURATION_FEATURES:
                      columns.append(
                          (
                              "Image",
                              "{}_{}_{}".format(
                                  C_IMAGE_QUALITY, feature, image_name
                              ),
                              COLTYPE_FLOAT,
                          )
                      )
                      sources.append(
                          [image_group.check_saturation, image_name]
                      )
  
          # Threshold measurements
          if image_group.calculate_threshold.value:
              all_threshold_groups = self.get_all_threshold_groups(
                  image_group
              )
              for image_name in selected_images:
                  for threshold_group in all_threshold_groups:
                      feature = threshold_group.threshold_feature_name(
                          image_name
                      )
                      columns.append(
                          (
                              "Image",
                              feature,
                              COLTYPE_FLOAT,
                          )
                      )
                      for agg in ("Mean", "Median", "Std"):
                          feature = (
                              threshold_group.threshold_feature_name(
                                  image_name, agg
                              )
                          )
                          columns.append(
                              (
                                  EXPERIMENT,
                                  feature,
                                  COLTYPE_FLOAT,
                                  {MCA_AVAILABLE_POST_RUN: True},
                              )
                          )
  
                      if image_group.use_all_threshold_methods:
                          sources.append(
                              [
                                  image_group.use_all_threshold_methods,
                                  image_name,
                              ]
                          )
                      else:
                          sources.append(
                              [
                                  threshold_group.threshold_method,
                                  image_name,
                              ]
                          )
  
      if return_sources:
          return columns, sources
      else:
          return columns
  
imports: import itertools
  import logging
  import cellprofiler_core.utilities.image
  import centrosome.cpmorphology
  import centrosome.haralick
  import centrosome.radial_power_spectrum
  import centrosome.threshold
  import centrosome.threshold
  import numpy
  import scipy.linalg.basic
  import scipy.ndimage
  from cellprofiler_core.constants.image import C_SCALING
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, EXPERIMENT, MCA_AVAILABLE_POST_RUN
  from cellprofiler_core.constants.module._identify import O_WEIGHTED_VARIANCE, O_ENTROPY, O_FOREGROUND, O_BACKGROUND
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import get_headless
  from cellprofiler_core.setting import Divider, HiddenCount, SettingsGroup, Binary, ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething, RemoveSettingButton
  from cellprofiler_core.setting.subscriber import ImageListSubscriber
  from cellprofiler_core.setting.text import ImageName, Integer, Float
  from cellprofiler.modules.threshold import O_THREE_CLASS, O_TWO_CLASS
label_desc: Use image node_id 18 for calling the MeasureImageQuality obj's underlying member method code with example usage: obj.get_measurement_columns(pipeline, return_sources) and returns: columns,  sources, columns