Skip to content

Commit

Permalink
STYLE: Use transformType in transform dict representation
Browse files Browse the repository at this point in the history
This is to be more consistent with `pixelType`, etc. for Image, Mesh,
PolyData representations.
  • Loading branch information
thewtex committed Apr 15, 2024
1 parent a895d7f commit 015c754
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
keys_to_test1 = [
"name",
"parametersValueType",
"transformName",
"transformType",
"inputDimension",
"outputDimension",
"inputSpaceName",
Expand Down
14 changes: 7 additions & 7 deletions Wrapping/Generators/Python/itk/support/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ def update_transform_dict(current_transform):
)
in_transform_dict["inputDimension"] = int(current_transform_type_split[2])
in_transform_dict["outputDimension"] = int(current_transform_type_split[3])
in_transform_dict["transformName"] = current_transform_type_split[0]
in_transform_dict["transformType"] = current_transform_type_split[0]

in_transform_dict["inputSpaceName"] = current_transform.GetInputSpaceName()
in_transform_dict["outputSpaceName"] = current_transform.GetOutputSpaceName()
Expand Down Expand Up @@ -1062,21 +1062,21 @@ def special_transform_check(transform_name):

# No template parameter needed for transforms having 2D or 3D name
# Also for some selected transforms
if special_transform_check(transform_dict[i]["transformName"]):
transform_template = getattr(itk, transform_dict[i]["transformName"])
if special_transform_check(transform_dict[i]["transformType"]):
transform_template = getattr(itk, transform_dict[i]["transformType"])
transform = transform_template[data_type].New()
# Currently only BSpline Transform has 3 template parameters
# For future extensions the information will have to be encoded in
# the transformName variable. The transform object once added in a
# the transformType variable. The transform object once added in a
# composite transform lose the information for other template parameters ex. BSpline.
# The Spline order is fixed as 3 here.
elif transform_dict[i]["transformName"] == "BSplineTransform":
transform_template = getattr(itk, transform_dict[i]["transformName"])
elif transform_dict[i]["transformType"] == "BSplineTransform":
transform_template = getattr(itk, transform_dict[i]["transformType"])
transform = transform_template[
data_type, transform_dict[i]["inputDimension"], 3
].New()
else:
transform_template = getattr(itk, transform_dict[i]["transformName"])
transform_template = getattr(itk, transform_dict[i]["transformType"])
if len(transform_template.items()[0][0]) > 2:
transform = transform_template[
data_type, transform_dict[i]["inputDimension"], transform_dict[i]["outputDimension"]
Expand Down

0 comments on commit 015c754

Please sign in to comment.