language: cn
model_unique_abbr: k_means_clustering_sagagis
version: 1.0
identification:
  docker_image_name: sagagis:base-8.1.0
  model_name: KMeans聚类（栅格-SAGAGRID）
  semantic: imagery classification
  description: 将图像像素值视为特征值，对其进行kmeans聚类
  category_application: 诊断型
  category_data:
  - 栅格数据
  keywords:
  - 图像分割
parameter_info:
  parameters:
  - arg_name: ' '
    param_type: param
    visible: false
    name: 工具包
    description: 工具包名称
    data_type: str
    data_semantic: name of tools in sagagis
    specification:
      default: imagery_classification
  - arg_name: ' '
    param_type: param
    visible: false
    name: 模型序号
    description: 模型序号
    data_type: int
    data_semantic: Model No in sagagis
    specification:
      default: 1
  - arg_name: GRIDS
    param_type: input_data
    name: 输入栅格文件
    description: 输入栅格文件，格式为grd或者sgrd。
    data_type: grd
    data_semantic: Grids
  - arg_name: CLUSTER
    param_type: output_data
    name: 输出栅格文件
    description: 输出栅格文件，格式为sgrd的栅格文件。
    data_type: grd
    data_semantic: Clusters
  - arg_name: STATISTICS
    param_type: output_data
    name: 统计数据
    description: 输出统计数据的文本文件，格式为csv。
    is_required: false
    data_type: csv
    data_semantic: Statistics
  - arg_name: METHOD
    param_type: param
    name: 聚类方式
    description: 对输入数据进行聚类的方式，“0”代表Iterative Minimum Distance，“1”代表Hill-Climbing，“2”代表Combined Minimum Distance / Hillclimbing
    is_required: false
    data_type: enum
    data_semantic: clustering method
    specification:
      default: 1
      enum:
      - 0
      - 1
      - 2
  - arg_name: NCLUSTER
    param_type: param
    name: 聚类数量
    description: 聚类数量的多少。整数型数值，最小值为2
    is_required: false
    data_type: int
    data_semantic: Number of clusters
    specification:
      default: 10
      range:
        - "[2,]"
  - arg_name: MAXITER
    param_type: param
    name: 最大迭代次数
    description: 单次运行的k-means算法的最大迭代次数，当设置为0时被忽略；整数型数值，推荐值为500
    is_required: false
    data_type: int
    data_semantic: Maximum Iterations
    specification:
      default: 0
      range:
        - "[0,]"
  - arg_name: NORMALISE
    param_type: param
    name: 归一化
    description: 在进行聚类前根据标准差对栅格数据进行自动归一化处理
    is_required: false
    data_type: bool
    data_semantic: Normalise
    specification:
      default: "False"
  - arg_name: INITIALIZE
    param_type: param
    name: 聚类中心初始化方法
    description: 初始化集群中心方法，“0”代表random，“1”代表periodical，“2”代表keep values
    is_required: false
    data_type: enum
    data_semantic: How to Initialize Cluster Centres
    specification:
      default: 0
      enum:
      - 0
      - 1
      - 2
  - arg_name: OLDVERSION
    param_type: param
    name: 老版本
    description: 是否使用老版本聚类方法，较慢但更节省内存
    is_required: false
    data_type: bool
    data_semantic: Old Version
    specification:
      default: "False"
  - arg_name: UPDATEVIEW
    param_type: param
    name: 更新视图
    description: 是否更新视图
    is_required: false
    data_type: bool
    data_semantic: Update View
    specification:
      default: "True"
application:
  domain: 图像分割
  objective: 将图像中特征较为相似的像素点进行聚类
  mechanism: 将多通道栅格数据转为多维特征数据，应用Kmeans对其进行划分
operation:
  usage: 此工具可用于对两个或多个输入执行 k 均值聚类操作。该工具会创建两个输出，包括分类影像和统计数据。
  exec_example:
  - docker run -v $(pwd):/data sagagis:base-8.1.0 imagery_classification 1 [-GRIDS <str>] [-CLUSTER <str>] [-STATISTICS <str>] [-METHOD <str>] [-NCLUSTER <num>] [-MAXITER <num>] [-NORMALISE <str>] [-INITIALIZE <str>] [-OLDVERSION <str>] [-UPDATEVIEW <str>]
  license:
  - SAGA-GIS-GNU General Public
  tips: 每个输入影像必须具有相同的行数和列数以及相同的空间范围，因为分析是逐个像素地执行的。任何输入图像中的 NoData 值都将导致从分析中删除相应的像素。
technique:
  language:
  - C++
  os:
  - Linux
  - Windows
  dependencies:
  - name: SAGA-GIS
    version: 8.1.0
source:
  maintainer: Shan Huang
  organization: Beijing University of Civil Engineering and Architecture
  contact: huangshan3mt@foxmail.com
  integrated_softwares:
  - name: SAGA-GIS
    version: 8.1.0
    license: GNU General Public
  references:
  - Forgy, E. (1965), Cluster analysis of multivariate data, efficiency vs. interpretability of classifications. Biometrics 21:768.
  - Rubin, J. (1967), Optimal classification into groups, an approach for solving the taxonomy problem. J. Theoretical Biology, 15:103-144.
  - https://saga-gis.sourceforge.io/saga_tool_doc/8.1.0/imagery_classification_1.html
