|
68 | 68 | print("Will calculate the following first order features: ") |
69 | 69 | for f in firstOrderFeatures.enabledFeatures.keys(): |
70 | 70 | print(" ", f) |
71 | | - print(getattr(firstOrderFeatures, "get%sFeatureValue" % f).__doc__) |
| 71 | + print(getattr(firstOrderFeatures, f"get{f}FeatureValue").__doc__) |
72 | 72 |
|
73 | 73 | print("Calculating first order features...") |
74 | 74 | results = firstOrderFeatures.execute() |
|
87 | 87 | print("Will calculate the following Shape features: ") |
88 | 88 | for f in shapeFeatures.enabledFeatures.keys(): |
89 | 89 | print(" ", f) |
90 | | - print(getattr(shapeFeatures, "get%sFeatureValue" % f).__doc__) |
| 90 | + print(getattr(shapeFeatures, f"get{f}FeatureValue").__doc__) |
91 | 91 |
|
92 | 92 | print("Calculating Shape features...") |
93 | 93 | results = shapeFeatures.execute() |
|
106 | 106 | print("Will calculate the following GLCM features: ") |
107 | 107 | for f in glcmFeatures.enabledFeatures.keys(): |
108 | 108 | print(" ", f) |
109 | | - print(getattr(glcmFeatures, "get%sFeatureValue" % f).__doc__) |
| 109 | + print(getattr(glcmFeatures, f"get{f}FeatureValue").__doc__) |
110 | 110 |
|
111 | 111 | print("Calculating GLCM features...") |
112 | 112 | results = glcmFeatures.execute() |
|
125 | 125 | print("Will calculate the following GLRLM features: ") |
126 | 126 | for f in glrlmFeatures.enabledFeatures.keys(): |
127 | 127 | print(" ", f) |
128 | | - print(getattr(glrlmFeatures, "get%sFeatureValue" % f).__doc__) |
| 128 | + print(getattr(glrlmFeatures, f"get{f}FeatureValue").__doc__) |
129 | 129 |
|
130 | 130 | print("Calculating GLRLM features...") |
131 | 131 | results = glrlmFeatures.execute() |
|
144 | 144 | print("Will calculate the following GLSZM features: ") |
145 | 145 | for f in glszmFeatures.enabledFeatures.keys(): |
146 | 146 | print(" ", f) |
147 | | - print(getattr(glszmFeatures, "get%sFeatureValue" % f).__doc__) |
| 147 | + print(getattr(glszmFeatures, f"get{f}FeatureValue").__doc__) |
148 | 148 |
|
149 | 149 | print("Calculating GLSZM features...") |
150 | 150 | results = glszmFeatures.execute() |
|
168 | 168 | logFirstorderFeatures.enableAllFeatures() |
169 | 169 | results = logFirstorderFeatures.execute() |
170 | 170 | for key, val in results.items(): |
171 | | - laplacianFeatureName = "{}_{}".format(imageTypeName, key) |
| 171 | + laplacianFeatureName = f"{imageTypeName}_{key}" |
172 | 172 | print(" ", laplacianFeatureName, ":", val) |
173 | 173 | # |
174 | 174 | # Show FirstOrder features, calculated on a wavelet filtered image |
|
186 | 186 | results = waveletFirstOrderFeaturs.execute() |
187 | 187 | print("Calculated firstorder features with wavelet ", decompositionName) |
188 | 188 | for key, val in results.items(): |
189 | | - waveletFeatureName = "{}_{}".format(str(decompositionName), key) |
| 189 | + waveletFeatureName = f"{str(decompositionName)}_{key}" |
190 | 190 | print(" ", waveletFeatureName, ":", val) |
0 commit comments