Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Move template files into revision control #3748

Merged
merged 3 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 67 additions & 6 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,22 @@ execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc)
# Create the appdata directory and translations directory
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/translations)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/apollo)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/autoreg) # *.def
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the non-ideal way of doing this in cmake that is functional, but not pretty. Punted a better solution to later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll add it to the todo list to make sure it doesn't fall through the cracks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds very good, thank you!

execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/autoseed) # *.def, *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnetref) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnetstats) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure) # *.def, *.def.example
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/findfeatures) # *.lis
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff) # *.lis
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/jigsaw) # *.pvl
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/kernels) # *.txt
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/templates/photometry) # *.pvl

execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/maps)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/images/icons)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/images/targets)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/labels)
execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/autoreg)
#execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/appdata/autoreg)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved autoreg from $ISISROOT/appdata/autoreg to $ISISROOT/appdata/templates/autoreg because it made more sense to me. Let me know if you agree or disagree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does


# Create an xml folder in the source directory that we will need later
set(sourceXmlFolder ${CMAKE_BINARY_DIR}/bin/xml)
Expand Down Expand Up @@ -507,7 +518,8 @@ add_dependencies(isis3 incs)
add_custom_target(appdata ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/serialnumbers/*.trn ${CMAKE_SOURCE_DIR}/appdata/translations/*.trn
${CMAKE_SOURCE_DIR}/appdata/translations/*.typ ${CMAKE_SOURCE_DIR}/src/*/apps/*/*.typ
${CMAKE_SOURCE_DIR}/src/*/apps/*/*.trn ${CMAKE_SOURCE_DIR}/src/*/apps/*/*.pft
${CMAKE_SOURCE_DIR}/src/*/apps/*/*.trn ${CMAKE_SOURCE_DIR}/src/*/translations/*.trn
${CMAKE_SOURCE_DIR}/src/*/apps/*/*.pft
${CMAKE_BINARY_DIR}/appdata/translations)
add_dependencies(isis3 appdata)

Expand All @@ -517,7 +529,56 @@ add_custom_target(templates ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/src/*/templates/*.def ${CMAKE_BINARY_DIR}/appdata/templates/apollo/)
add_dependencies(isis3 templates)

#execute_command(cp -r ${CMAKE_SOURCE_DIR}/src/*/templates/*.pvl ${CMAKE_BINARY_DIR}/appdata/templates)
# Add custom build target to copy modified template files to the build/appdata/templates
# directory. (As above - may need to be updated)
add_custom_target(autoreg ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/autoreg/*.def ${CMAKE_BINARY_DIR}/appdata/templates/autoreg/)
add_dependencies(isis3 autoreg)

add_custom_target(autoseed ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/autoseed/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/autoseed/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/autoseed/)
add_dependencies(isis3 autoseed)

add_custom_target(cnetref ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnetref/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnetref/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnetref/)
add_dependencies(isis3 cnetref)

add_custom_target(cnetstats ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnetstats/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnetstats/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnetstats/)
add_dependencies(isis3 cnetstats)

add_custom_target(cnetvalid ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/cnet_validmeasure/*.def ${CMAKE_SOURCE_DIR}/appdata/templates/cnet_validmeasure/*.def.example
${CMAKE_BINARY_DIR}/appdata/templates/cnet_validmeasure/)
add_dependencies(isis3 cnetvalid)

add_custom_target(findfeatures ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/findfeatures/*.lis
${CMAKE_BINARY_DIR}/appdata/templates/findfeatures/)
add_dependencies(isis3 findfeatures)

add_custom_target(fullcnetdiff ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/fullcnetdiff/*.def
${CMAKE_BINARY_DIR}/appdata/templates/fullcnetdiff/)
add_dependencies(isis3 fullcnetdiff)

add_custom_target(jigsaw ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/jigsaw/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/jigsaw/)
add_dependencies(isis3 jigsaw)

add_custom_target(kernels ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/kernels/*.txt
${CMAKE_BINARY_DIR}/appdata/templates/kernels/)
add_dependencies(isis3 kernels)

add_custom_target(photometry ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/templates/photometry/*.pvl
${CMAKE_BINARY_DIR}/appdata/templates/photometry/)
add_dependencies(isis3 photometry)

# Either add these for maps, labels, autoreg, images or approach in a different way.

Expand All @@ -540,9 +601,9 @@ add_custom_target(labels ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/labels/*.pft ${CMAKE_BINARY_DIR}/appdata/labels)
add_dependencies(isis3 labels)

add_custom_target(autoreg ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/appdata/autoreg/*.def ${CMAKE_BINARY_DIR}/appdata/autoreg)
add_dependencies(isis3 autoreg)
#add_custom_target(autoreg ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different
# ${CMAKE_SOURCE_DIR}/appdata/autoreg/*.def ${CMAKE_BINARY_DIR}/appdata/autoreg)
#add_dependencies(isis3 autoreg)

# Add a custom build target to clean out everything that gets added to the source
# directory during the build process.
Expand Down
256 changes: 256 additions & 0 deletions isis/appdata/templates/autoreg/coreg.adaptgruen.p1515s3030.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
Object = AutoRegistration
Group = Algorithm
# This is the adaptive gruen algorithm, which provides adaptive image
# (chip) registration using an Affine transform to iteratively adjust
# the search chip at each iteration. Each iteration solves for new
# adjustments to the Affine transform until the 6 affine parameters
# fall below the tolerances as specified by the following parameters.
#REQUIRED
Name = AdaptiveGruen

# The tolerance for the goodness-of-fit. For the
# AdaptiveGruen algorithm, the goodness-of-fit value must
# be less than Tolerance before the algorithm is considered
# to have converged to a user-acceptable solution.
#Possible Values: [0,infinity)
#REQUIRED
Tolerance = 0.1

# The Maximum number of iterations the algorithm is allowed to perform
# in an attempt to converge before failing and returning no registration.
#Possible Values: [1,infinity), integer
#REQUIRED
MaximumIterations = 30

# The AffineTolerance specifies the amount of offset in pixels an affine
# derived point is allowed to deviate from the orginal match point.
#Possible Values: [0,infinity)
#OPTIONAL
AffineTolerance = 5.0

# The AffineTranslationTolerance specifies the threshold convergence value
# of the affine translation shift in line/sample between each Gruen match
# iteration. If the amount of affine translation computed in the Gruen
# algorithm is less than the AffineTranslationTolerance, that point is
# deemed a match point for the purposes of the translation portion of the
# registered point.
#Possible Values: [0,infinity)
#OPTIONAL
AffineTranslationTolerance = 0.2

# The AffineScaleTolerance specifies the threshold convergence value of the
# affine scale in line/sample between each Gruen match iteration. If the
# amount of the affine translation computed in the Gruen algorithm is
# less than the AffineScaleTolerance, that point is deemed a match point
# for the purposes of the scaling portion of the registered point.
#Possible Values: [0,infinity)
#OPTIONAL
AffineScaleTolerance = 0.7

# The AffineShearTolerance specifies the threshold convergence value of the
# affine scale in line/sample between each Gruen match iteration. If the
# amount of the affine translation computed in the Gruen algorithm is
# less than the AffineShearTolerance, that point is deemed a match point
# for the purposes of the shear portion of the registered point.
#Possible Values: [0,infinity)
#OPTIONAL
#AffineShearTolerance = 0.7

#The SpiceTolerance defines the amount of offset in pixels a registration
# is allowed to deviate from a registered point.
#Possible Values: [0,infinity)
#OPTIONAL
#SpiceTolerance = 7.0

#The RadioShiftTolerance specifies the threshold convergence value for the
# radiometric shift of the pixel value between each Gruen match iteration.
# If the amount of the radiometric shift computed in the Gruen algorithm is
# less than the RadioShiftTolerance, that point is deemed a match point
# for the purposes of the radiometric shift portion of the registered point.
# This tolerance value depends heavily on the radiometric properties of
# your images.
#Possible Values: (-infinity,infinity)
#OPTIONAL
#RadioShiftTolerance = 256

#The RadioGainMinTolerance specifies the minimum value for the
# radiometric gain of the pixel value between each Gruen match iteration.
# If the amount of the radiometric gain computed in the Gruen algorithm is
# greater than the RadioGainMinTolerance and is less than
# RadioGainMaxTolerance, that point is deemed a match point for the
# purposes of the radiometric gain portion of the registered point.
# This tolerance value depends heavily on the radiometric properties of
# your images.
#Possible Values: (-infinity,infinity)
#OPTIONAL
#RadioGainMinTolerance = -0.75

#The RadioGainMaxTolerance specifies the maximum value for the
# radiometric gain of the pixel value between each Gruen match iteration.
# If the amount of the radiometric gain computed in the Gruen algorithm is
# greater than the RadioGainMinTolerance and is less than
# RadioGainMaxTolerance, that point is deemed a match point for the
# purposes of the radiometric gain portion of the registered point.
# This tolerance value depends heavily on the radiometric properties of
# your images.
#Possible Values: (-infinity,infinity)
#OPTIONAL
#RadioGainMaxTolerance = 3.0

#FitChipScale = 0.1

#The DefaultRadioShift sets the default value for the radiometric shift
# value used as a starting point in the Gruen algorithm.
#Possible Values: (-infinity,infinity)
#OPTIONAL
#DefaultRadioShift = 0.0

#The DefaultRadioGain sets the default value for the radiometric gain
# value used as a starting point in the Gruen algorithm.
#Possible Values: (-infinity,infinity)
#OPTIONAL
#DefaultRadioGain = 0.0

# Calculate the registration to subpixel accuracy. This is a
# boolean (True or False).
#Possible Values: {True, False}
#OPTIONAL
#SubPixelAccuracy = True

# Reduce the size of of the Pattern and Search chips by a
# the ReductionFactor for a first-run through the data
# to find a low-accuracy match. Then focus the
# full-accuracy match to the surrounding area.
#Possible Values: Natural Numbers
#OPTIONAL
#ReductionFactor = 1

# Apply a Sobel gradient filter to the chips before running the
# pattern matching Algorithm. This essentially highlights
# edges within the chips, possibly increasing the chance of
# finding a good match between the search and pattern chips.
#Possible Values: {None, Sobel}
#OPTIONAL
#Gradient = None

# If the two images to be registered do not have the same
# geometry, pattern matching becomes more difficult. This
# option informs the algorithm to warp the pattern cube to
# match the geometry of the search cube by using map
# projections and/or camera models. The warping requires
# interpolation, and the type of interpolation is chosen here.
#Possible Values: {NearestNeighborType, BiLinearType, CubicConvolutionType}
#OPTIONAL
#ChipInterpolator = NearestNeighborType
EndGroup

#Pattern Chip Definitions
Group = PatternChip
#Size of the PatternChip in Samples and Lines
#Possible Values: Natural Numbers
#REQUIRED
Samples = 15
Lines = 15

#The minimum/maximum pixel value the algorithm should use for registration.
# If a pixel is outside of this range, then it will not be used in the
# registration calculations.
#Possible Values: (-infinity, infinity), ValidMinimum < ValidMaximum
#OPTIONAL
#ValidMinimum = -100
#ValidMaximum = 100

#The MinimumZScore is used to guarantee that the pattern chip has
# enough variability--if the chip is too smooth, spurious matches
# are likely to occur.
#Possible Values: (0.0,infinity)
#OPTIONAL
#MinimumZScore = 1.0

#The ValidPercent parameter specifies how many invalid pixels
# (NULL, HIS, etc.) are allowed in the chip before the chip is
# considered invalid and the match fails.
#Possible Values: (0.0,100.0]
#OPTIONAL
#ValidPercent = 50.0
EndGroup

#Search Chip Definitions
Group = SearchChip
#Size of the SearchChip in Samples and Lines
#Possible Values: Natural Numbers
#REQUIRED
Samples = 30
Lines = 30

#The minimum/maximum pixel value the algorithm should use for registration.
# If a pixel is outside of this range, then it will not be used in the
# registration calculations.
#Possible Values: (-infinity, infinity), ValidMinimum < ValidMaximum
#OPTIONAL
#ValidMinimum = -100
#ValidMaximum = 100

#The SubchipValidPercent parameter specifies how many invalid pixels
# (NULL, HIS, etc.) are allowed in the subchip before it is
# considered invalid and the match fails.
#Possible Values: (0.0, 100.0]
#OPTIONAL
#SubchipValidPercent = 50.0
EndGroup

#If the SubPixelAccuracy parameter is TRUE, then a continuous surface
# based on the fit chip is generated. A least squares fit is then used
# to estimate the true registration position (likely to be between pixels).
Group = SurfaceModel
#The result of a sub-pixel accuracy computation is likely to move
# the result away from its original whole-pixel fit. However,
# sometimes the move could be so drastic that it calls into
# question the validity of the match. This tolerance value
# thus specifies the max number of pixels the sub-pixel accuracy
# computation can move the best fit before the registration is rejected
# entirely.
#Possible Values (0.0, infinity)
#OPTIONAL
#DistanceTolerance = 1.5

#When refining a whole-pixel match to sub-pixel accuracy, it is important
# to consider how much area around that best whole-pixel fit to sample
# for constructing a surface model. The WindowSize keyword defines the
# size of the window, centered on the best whole-pixel match, that will
# be used for modelling the surface. Values for WindowSize specify the
# N of an NxN chip, and must be odd numbers greater than or equal to 3.
#Possible Values: [3, infinity), odd integer
#OPTIONAL
#WindowSize = 5

#After the least squares fit is performed to model a surface, the
# ideal result is a circular formation of goodness-of-fit values
# improving towards the center of the surface. The less circular,
# or more "eccentric", the formation of goodness-of-fit values,
# the less likely the modelling result is accurate. The
# conditions under which a high ratio occurs is when there are
# primiarily linear features in the search and pattern chips.
# In an attempt to let the user define what constitutes a tolerable
# amount of eccentricity in their surface models, we introduce the
# notion of an "Eccentricity Ratio". Here we think of eccentricity
# as a ratio between the semi-major and semi-minor axes of an ellipse.
#Possible Values [1.0, infinity]
#OPTIONAL
#EccentricityRatio = 1.0

#The least squares fit performed to construct the surface model
# takes discrete data from the whole-pixels around the best-fit.
# When these discrete data are fit with a continuous function,
# there is likely going to be some amount of error between the
# original value for some pixel and its interpolated value in the
# least squares solution. The ResidualTolerance keyword thus
# allows the user to specify the maximum average residual, or
# mean absolute error, for all pixels in the surface model area,
# that will be tolerated before the sub-pixel accuracy computation
# is rejected and the registration fails for that point.
#Possible Values: [0.0, infinity]
#OPTIONAL
#ResidualTolerance = 0.0
EndGroup
EndObject
Loading