Skip to content

Commit cb1b6e7

Browse files
authored
Merge pull request #228 from mseng10/order-submodules
2 parents 4121fa7 + b33b380 commit cb1b6e7

File tree

251 files changed

+509
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+509
-499
lines changed

Utilities/CreateNewExample.py.in

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import re
2828
import sys
2929

3030
from cookiecutter.main import cookiecutter
31+
from titlecase import titlecase
3132
from os.path import join as pjoin
3233

3334

@@ -51,6 +52,12 @@ def write_all_itk_headers(itk_source_dir):
5152
output.write(f + u'\n')
5253
return output
5354

55+
def get_all_itk_headers(itk_source_dir):
56+
output = []
57+
for root, dirs, files in os.walk(pjoin(itk_source_dir, 'Modules')):
58+
for f in fnmatch.filter(files, 'itk*.h'):
59+
output.append(f)
60+
return output
5461

5562
def words(text):
5663
temp = re.findall('itk[A-Z][a-zA-Z_0-9]+', text)
@@ -102,8 +109,14 @@ def itkcorrect(word, NWORDS, alphabet):
102109

103110

104111
def space_out_camel_case(s):
105-
return re.sub('((?=[A-Z][a-z])|(?<=[a-z])(?=[A-Z]))', ' ', s)
112+
return re.sub('((?=[A-Z][a-z])|(?<=[a-z])(?=[A-Z]))', ' ', s).strip()
106113

114+
def itk_abbreviations(word,**kwargs):
115+
if word.upper() in ('ITK','VTK','RGB','VTP','FFT','FEM','TIFF','GMM','EM',
116+
'CV','GPU','BMP','CSV','DCMTK','GDCM','GE','GIPL','HDF5',
117+
'IPL','JPEG','JPEG2000','LSM','BYU','MINC','MRC','NIFTI',
118+
'NRRD','REC','PNG','RAW','XML','RTK','DICOM','2D','3D','IO'):
119+
return word.upper()
107120

108121
def get_group_and_module_from_class_name(itk_src, class_name):
109122
""" Get the ITK group and module a class belongs to.
@@ -189,7 +202,7 @@ def main():
189202
or default_class_name
190203
example_name = get_input("example_name [" + default_example_name + "]: ")\
191204
or default_example_name
192-
example_title = space_out_camel_case(example_name)
205+
example_title = titlecase(space_out_camel_case(example_name), callback=itk_abbreviations)
193206
example_synopsis = get_input("example_synopsis [" + default_synopsis + "]: ")\
194207
or default_synopsis
195208

src/Bridge/VtkGlue/ConvertAnRGBitkImageTovtkImageData/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/ConvertAnitkImageTovtkImageData/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VTKImageToITKImage/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeEvolvingDense2DLevelSetAsElevationMap/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeEvolvingDense2DLevelSetZeroSet/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeStaticDense2DLevelSetAsElevationMap/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeStaticDense2DLevelSetZeroSet/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeStaticMalcolm2DLevelSetLayers/Documentation.rst

Lines changed: 1 addition & 1 deletion

src/Bridge/VtkGlue/VisualizeStaticShi2DLevelSetLayers/Documentation.rst

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)