Skip to content

Commit

Permalink
[otb] keep track of algorithm key
Browse files Browse the repository at this point in the history
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@144 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
julien.malik@gmail.com committed Apr 23, 2012
1 parent a8a4c9d commit 12d6f65
Show file tree
Hide file tree
Showing 56 changed files with 79 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/sextante/otb/OTBAlgorithm.py
Expand Up @@ -33,10 +33,18 @@ def __deepcopy__(self,memo):
def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/otb.png")

def helpFile(self):
folder = os.path.join( OTBUtils.otbDescriptionPath(), 'doc' )
if str(folder).strip() != "":
helpfile = os.path.join( str(folder), self.appkey + ".html")
return helpfile
return None

def defineCharacteristicsFromFile(self):
lines = open(self.descriptionFile)
line = lines.readline().strip("\n").strip()
self.appkey = line
line = lines.readline().strip("\n").strip()
self.cliName = line
line = lines.readline().strip("\n").strip()
self.name = line
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/BandMath.txt
@@ -1,3 +1,4 @@
BandMath
otbcli_BandMath
Band Math
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/BundleToPerfectSensor.txt
@@ -1,3 +1,4 @@
BundleToPerfectSensor
otbcli_BundleToPerfectSensor
Bundle to perfect sensor
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ColorMapping.txt
@@ -1,3 +1,4 @@
ColorMapping
otbcli_ColorMapping
Color Mapping
Learning
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/CompareImages.txt
@@ -1,3 +1,4 @@
CompareImages
otbcli_CompareImages
Images comparaison
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ComputeImagesStatistics.txt
@@ -1,3 +1,4 @@
ComputeImagesStatistics
otbcli_ComputeImagesStatistics
Compute Images second order statistics
Learning
Expand Down
@@ -1,3 +1,4 @@
ComputePolylineFeatureFromImage
otbcli_ComputePolylineFeatureFromImage
Compute Polyline Feature From Image
Feature Extraction
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ConcatenateImages.txt
@@ -1,3 +1,4 @@
ConcatenateImages
otbcli_ConcatenateImages
Images Concatenation
Image Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ConcatenateVectorData.txt
@@ -1,3 +1,4 @@
ConcatenateVectorData
otbcli_ConcatenateVectorData
Concatenate
Vector Data Manipulation
Expand Down
@@ -1,3 +1,4 @@
ConnectedComponentSegmentation
otbcli_ConnectedComponentSegmentation
Connected Component Segmentation
Segmentation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Convert.txt
@@ -1,3 +1,4 @@
Convert
otbcli_Convert
Image Conversion
Image Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ConvertCartoToGeoPoint.txt
@@ -1,3 +1,4 @@
ConvertCartoToGeoPoint
otbcli_ConvertCartoToGeoPoint
Cartographic to geographic coordinates conversion
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ConvertSensorToGeoPoint.txt
@@ -1,3 +1,4 @@
ConvertSensorToGeoPoint
otbcli_ConvertSensorToGeoPoint
Convert Sensor Point To Geographic Point
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/DSFuzzyModelEstimation.txt
@@ -1,3 +1,4 @@
DSFuzzyModelEstimation
otbcli_DSFuzzyModelEstimation
Fuzzy Model estimation
Feature Extraction
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ExtractROI.txt
@@ -1,3 +1,4 @@
ExtractROI
otbcli_ExtractROI
Extract ROI
Image Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/FineRegistration.txt
@@ -1,3 +1,4 @@
FineRegistration
otbcli_FineRegistration
Fine Registration
Stereo
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/GridBasedImageResampling.txt
@@ -1,3 +1,4 @@
GridBasedImageResampling
otbcli_GridBasedImageResampling
Grid Based Image Resampling
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/HooverCompareSegmentation.txt
@@ -1,3 +1,4 @@
HooverCompareSegmentation
otbcli_HooverCompareSegmentation
Hoover compare segmentation
Segmentation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/HyperspectralUnmixing.txt
@@ -1,3 +1,4 @@
HyperspectralUnmixing
otbcli_HyperspectralUnmixing
Hyperspectral data unmixing
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ImageEnvelope.txt
@@ -1,3 +1,4 @@
ImageEnvelope
otbcli_ImageEnvelope
Image Envelope
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ImageSVMClassifier.txt
@@ -1,3 +1,4 @@
ImageSVMClassifier
otbcli_ImageSVMClassifier
Image SVM Classification
Learning
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/KMeansClassification.txt
@@ -1,3 +1,4 @@
KMeansClassification
otbcli_KMeansClassification
Unsupervised KMeans image classification
Learning
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/KmzExport.txt
@@ -1,3 +1,4 @@
KmzExport
otbcli_KmzExport
Image to KMZ Export
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/LineSegmentDetection.txt
@@ -1,3 +1,4 @@
LineSegmentDetection
otbcli_LineSegmentDetection
Line segment detection
Feature Extraction
Expand Down
@@ -1,3 +1,4 @@
MaximumAutocorrelationFactor
otbcli_MaximumAutocorrelationFactor
Maximum Auto-correlation Factor Decomposition
Image Filtering
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/MeanShiftSegmentation.txt
@@ -1,3 +1,4 @@
MeanShiftSegmentation
otbcli_MeanShiftSegmentation
Mean Shift segmentation
Segmentation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/MultiResolutionPyramid.txt
@@ -1,3 +1,4 @@
MultiResolutionPyramid
otbcli_MultiResolutionPyramid
Multi Resolution Pyramid
Image Manipulation
Expand Down
@@ -1,3 +1,4 @@
MultivariateAlterationDetector
otbcli_MultivariateAlterationDetector
Multivariate alteration detector
Feature Extraction
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/OSMDownloader.txt
@@ -1,3 +1,4 @@
OSMDownloader
otbcli_OSMDownloader
Open Street Map layers importations applications
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ObtainUTMZoneFromGeoPoint.txt
@@ -1,3 +1,4 @@
ObtainUTMZoneFromGeoPoint
otbcli_ObtainUTMZoneFromGeoPoint
Obtain UTM Zone From Geo Point
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/OpticalCalibration.txt
@@ -1,3 +1,4 @@
OpticalCalibration
otbcli_OpticalCalibration
Optical calibration
Calibration
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/OrthoRectification.txt
@@ -1,3 +1,4 @@
OrthoRectification
otbcli_OrthoRectification
Ortho-rectification
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/PixelValue.txt
@@ -1,3 +1,4 @@
PixelValue
otbcli_PixelValue
Pixel Value
Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/PixelWiseBlockMatching.txt
@@ -1,3 +1,4 @@
PixelWiseBlockMatching
otbcli_PixelWiseBlockMatching
Pixel-wise Block-Matching
Stereo
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Quicklook.txt
@@ -1,3 +1,4 @@
Quicklook
otbcli_Quicklook
Quick Look
Image Manipulation
Expand Down
@@ -1,3 +1,4 @@
RadiometricVegetationIndices
otbcli_RadiometricVegetationIndices
Radiometric Vegetation
Feature Extraction
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/RadiometricWaterIndices.txt
@@ -1,3 +1,4 @@
RadiometricWaterIndices
otbcli_RadiometricWaterIndices
Radiometric Water
Feature Extraction
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Rasterization.txt
@@ -1,3 +1,4 @@
Rasterization
otbcli_Rasterization
Rasterization
Vector Data Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/ReadImageInfo.txt
@@ -1,3 +1,4 @@
ReadImageInfo
otbcli_ReadImageInfo
Read image information
Image Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Rescale.txt
@@ -1,3 +1,4 @@
Rescale
otbcli_Rescale
Rescale Image
Image Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/RigidTransformResample.txt
@@ -1,3 +1,4 @@
RigidTransformResample
otbcli_RigidTransformResample
Image resampling with a rigid transform
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/SOMClassification.txt
@@ -1,3 +1,4 @@
SOMClassification
otbcli_SOMClassification
SOM Classification
Learning
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/SarRadiometricCalibration.txt
@@ -1,3 +1,4 @@
SarRadiometricCalibration
otbcli_SarRadiometricCalibration
SAR Radiometric calibration
Calibration
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Smoothing.txt
@@ -1,3 +1,4 @@
Smoothing
otbcli_Smoothing
Smoothing
Image Filtering
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/SplitImage.txt
@@ -1,3 +1,4 @@
SplitImage
otbcli_SplitImage
Split Image
Image Manipulation
Expand Down
@@ -1,3 +1,4 @@
StereoRectificationGridGenerator
otbcli_StereoRectificationGridGenerator
Stereo-rectification deformation grid generator
Geometry
Expand Down
@@ -1,3 +1,4 @@
StereoSensorModelToElevationMap
otbcli_StereoSensorModelToElevationMap
Stereo sensor model to elevation map
Stereo
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/Superimpose.txt
@@ -1,3 +1,4 @@
Superimpose
otbcli_Superimpose
Superimpose sensor
Geometry
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/TrainSVMImagesClassifier.txt
@@ -1,3 +1,4 @@
TrainSVMImagesClassifier
otbcli_TrainSVMImagesClassifier
Train SVM classifier from multiple images
Learning
Expand Down
@@ -1,3 +1,4 @@
ValidateSVMImagesClassifier
otbcli_ValidateSVMImagesClassifier
Validate SVM Images Classifier
Learning
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/VectorDataDSValidation.txt
@@ -1,3 +1,4 @@
VectorDataDSValidation
otbcli_VectorDataDSValidation
Vector Data validation
Feature Extraction
Expand Down
@@ -1,3 +1,4 @@
VectorDataExtractROIApplication
otbcli_VectorDataExtractROIApplication
VectorData Extract ROI
Vector Data Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/VectorDataSetField.txt
@@ -1,3 +1,4 @@
VectorDataSetField
otbcli_VectorDataSetField
Vector data set field
Vector Data Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/VectorDataTransform.txt
@@ -1,3 +1,4 @@
VectorDataTransform
otbcli_VectorDataTransform
Vector Data Transformation
Vector Data Manipulation
Expand Down
1 change: 1 addition & 0 deletions src/sextante/otb/description/VertexComponentAnalysis.txt
@@ -1,3 +1,4 @@
VertexComponentAnalysis
otbcli_VertexComponentAnalysis
Vertex Component Analysis
Miscellaneous
Expand Down
19 changes: 17 additions & 2 deletions src/sextante/otb/helper/generate_application_descriptors.py
Expand Up @@ -21,6 +21,7 @@ def generate_all_app_descriptors( ) :
for appliname in get_app_list():
appliIdx = appliIdx+1
generate_app_descriptor( appliname )
#generate_app_doc( appliname )

def generate_app_descriptor( appliname ) :
print appliname
Expand All @@ -30,16 +31,18 @@ def generate_app_descriptor( appliname ) :

out = ""

# the application key
out += appliname + endl

# the executable
out += "otbcli_" + appliname + endl

# long name
# for the moment, long name == short name
out += convertendl(appInstance.GetDocName()) + endl

# group
out += get_group(appInstance) + endl

for paramKey in appInstance.GetParametersKeys():
pdesc = generate_param_descriptor(appInstance, paramKey)
if len(pdesc) > 0:
Expand All @@ -48,6 +51,18 @@ def generate_app_descriptor( appliname ) :
with open( os.path.join(outputpath, appliname + '.txt'), 'w' ) as outfile:
outfile.write(out)

def generate_app_doc( appliname ) :
appInstance = otbApplication.Registry.CreateApplication(appliname)
appInstance.UpdateParameters() # TODO need this ?
html = appInstance.GetHtmlExample()

docpath= os.path.join(outputpath, 'doc')
if not os.path.exists(docpath):
os.makedirs(docpath)

with open( os.path.join(docpath, appliname + '.html'), 'w' ) as outfile:
outfile.write(html)

def get_group( appInstance ) :
tags = appInstance.GetDocTags()
sectionTags = ["Image Manipulation","Vector Data Manipulation", "Calibration","Geometry", "Image Filtering","Feature Extraction","Stereo","Learning","Segmentation"]
Expand Down

0 comments on commit 12d6f65

Please sign in to comment.