Skip to content

Commit a73ed12

Browse files
Médéric RibreuxMédéric RIBREUX
Médéric Ribreux
authored and
Médéric RIBREUX
committedMay 29, 2016
Add i.segment algorithm
1 parent 7bc5338 commit a73ed12

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed
 
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
i.segment
2+
Identifies segments (objects) from imagery data.
3+
Imagery (i.*)
4+
ParameterMultipleInput|input|Input rasters|3|False
5+
ParameterNumber|threshold|Difference threshold between 0 and 1|0.0|1.0|0.5|False
6+
ParameterSelection|method|Segmentation method|region_growing|0
7+
ParameterSelection|similarity|Similarity calculation method|euclidean;manhattan|0
8+
ParameterNumber|minsize|Minimum number of cells in a segment|1|100000|1|True
9+
ParameterNumber|memory|Amount of memory to use in MB|1|None|300|True
10+
ParameterNumber|iterations|Maximum number of iterations|1|None|20|True
11+
ParameterRaster|seeds|Name for input raster map with starting seeds|True
12+
ParameterRaster|bounds|Name of input bounding/constraining raster map|True
13+
*ParameterBoolean|-d|Use 8 neighbors (3x3 neighborhood) instead of the default 4 neighbors for each pixel|False
14+
*ParameterBoolean|-w|Weighted input, do not perform the default scaling of input raster maps|False
15+
OutputRaster|output|Segmented Raster
16+
OutputRaster|goodness|Goodness Raster

‎python/plugins/processing/algs/grass7/ext/i.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def regroupRasters(alg, field, groupField, subgroupField=None, sigsetField=None)
118118

119119
command = 'i.group group={}{} input={}'.format(
120120
group.value,
121-
' subgroup={}'.format(subgroup.value) if subgroup else '',
121+
' subgroup={}'.format(subgroup.value) if subgroupField else '',
122122
','.join([alg.exportedLayers[f] for f in rastersList])
123123
)
124124
alg.commands.append(command)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
i_segment.py
6+
------------
7+
Date : March 2016
8+
Copyright : (C) 2016 by Médéric Ribreux
9+
Email : medspx at medspx dot fr
10+
***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************
18+
"""
19+
20+
__author__ = 'Médéric Ribreux'
21+
__date__ = 'March 2016'
22+
__copyright__ = '(C) 2016, Médéric Ribreux'
23+
24+
# This will get replaced with a git SHA1 when you do a git archive
25+
26+
__revision__ = '$Format:%H$'
27+
28+
from i import regroupRasters
29+
30+
31+
def processCommand(alg):
32+
# Regroup rasters
33+
regroupRasters(alg, 'input', 'group')

‎python/plugins/processing/algs/grass7/ext/i_tasscap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28-
from i import multipleOutputDir, verifyRasterNum, regroupRasters
28+
from i import multipleOutputDir, verifyRasterNum
2929
from processing.core.parameters import getParameterFromString
3030

3131

0 commit comments

Comments
 (0)
Please sign in to comment.