Skip to content

Commit 659ccb6

Browse files
committed
Initial Commit of code that can parse a Zeiss Montage data set. We are only creating the Data Containers and the meta AttributeMatrix at this point. No attempt to create the Bundles or read the actual image data from the image files. No attempt to read more than a single slice of data.
0 parents  commit 659ccb6

23 files changed

+4976
-0
lines changed

CMakeLists.txt

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
#--////////////////////////////////////////////////////////////////////////////
2+
#-- Your License or copyright can go here
3+
#--////////////////////////////////////////////////////////////////////////////
4+
5+
project(ZeissImport)
6+
7+
set(PLUGIN_NAME ZeissImport)
8+
9+
# --------------------------------------------------------------------
10+
# Look for Qt 4 as we need it for the plugin GUI to be generated
11+
if(NOT QT4_FOUND)
12+
message(FATAL_ERROR "Qt 4 is Needed for this ${PLUGIN_NAME}Plugin.")
13+
endif()
14+
include( ${QT_USE_FILE} )
15+
16+
17+
set(${PLUGIN_NAME}_Project_SRCS "")
18+
19+
include(${DREAM3DProj_SOURCE_DIR}/Source/DREAM3DLib/DREAM3DLibMacros.cmake)
20+
#-------
21+
# Start writing this header file
22+
set(AllFiltersHeaderFile ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/${PLUGIN_NAME}Filters.h_tmp)
23+
file(WRITE ${AllFiltersHeaderFile} "#ifndef _${PLUGIN_NAME}_Filters_H_\n#define _${PLUGIN_NAME}_Filters_H_\n\n")
24+
25+
# --------------------------------------------------------------------
26+
# Create a File that will register all of the DREAM3D Filters
27+
set(RegisterKnownFiltersFile ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/RegisterKnownFilters.cpp_tmp)
28+
file(WRITE ${RegisterKnownFiltersFile} "/* This file was AUTO GENERATED During the CMake Run. DO NOT EDIT THIS FILE. Edit the CMake files that generate this file */\n")
29+
file(APPEND ${RegisterKnownFiltersFile} "/* The CMake code that generates this file is located in ${CMAKE_CURRENT_LIST_FILE}*/\n")
30+
file(APPEND ${RegisterKnownFiltersFile} "/* This file will be directly included in another source file. */\n")
31+
file(APPEND ${RegisterKnownFiltersFile} "#include \"${PLUGIN_NAME}Filters.h\"\n\n")
32+
file(APPEND ${RegisterKnownFiltersFile} "\nvoid ${PLUGIN_NAME}Plugin::registerFilters(FilterManager* fm)\n{\n")
33+
34+
# --------------------------------------------------------------------
35+
# Generate a file with all of our MOC'ed sources and headers
36+
set(FilterWidget_GEN_HDRS_File ${${PLUGIN_NAME}_BINARY_DIR}/FilterWidget_GEN_HDRS_File.cmake)
37+
set(FilterWidget_GEN_SRCS_File ${${PLUGIN_NAME}_BINARY_DIR}/FilterWidget_GEN_SRCS_File.cmake)
38+
file(WRITE ${FilterWidget_GEN_HDRS_File})
39+
file(WRITE ${FilterWidget_GEN_SRCS_File})
40+
41+
set(Project_SRCS "")
42+
43+
# Add in our Filter classes
44+
include(${${PLUGIN_NAME}_SOURCE_DIR}/${PLUGIN_NAME}Filters/SourceList.cmake)
45+
# Add in our Plugin Specific FilterParameterWidgets
46+
include(${${PLUGIN_NAME}_SOURCE_DIR}/FilterParameterWidgets/SourceList.cmake)
47+
#-----------------------------------------------------
48+
# Include any extra Widgets that this plugin needs
49+
include(${${PLUGIN_NAME}_SOURCE_DIR}/Widgets/SourceList.cmake)
50+
51+
set(${PLUGIN_NAME}_Project_SRCS ${Project_SRCS})
52+
53+
#-----------------------------------------------------
54+
# Close up all the files that we just generated
55+
file(APPEND ${AllFiltersHeaderFile} "\n#endif\n")
56+
file(APPEND ${RegisterKnownFiltersFile} "\n }\n")
57+
58+
cmpReplaceFileIfDifferent(OLD_FILE_PATH ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/${PLUGIN_NAME}Filters.h
59+
NEW_FILE_PATH ${AllFiltersHeaderFile} )
60+
61+
cmpReplaceFileIfDifferent(OLD_FILE_PATH ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/RegisterKnownFilters.cpp
62+
NEW_FILE_PATH ${RegisterKnownFiltersFile} )
63+
64+
set(AllFiltersHeaderFile ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/${PLUGIN_NAME}Filters.h)
65+
set(RegisterKnownFiltersFile ${${PLUGIN_NAME}_BINARY_DIR}/${PLUGIN_NAME}Filters/RegisterKnownFilters.cpp)
66+
67+
#--------------------------
68+
include_directories( ${HDF5_INCLUDE_DIR} )
69+
include_directories( ${PROJECT_CODE_DIR} )
70+
include_directories( ${QtSupport_BINARY_DIR} )
71+
include_directories( ${QtSupport_SOURCE_DIR} )
72+
73+
74+
get_filename_component(PLUGINS_SOURCE_DIR ${${PLUGIN_NAME}_SOURCE_DIR} DIRECTORY)
75+
get_filename_component(PLUGINS_BINARY_DIR ${${PLUGIN_NAME}_BINARY_DIR} DIRECTORY)
76+
77+
include_directories( ${${PLUGIN_NAME}_BINARY_DIR} )
78+
include_directories( ${${PLUGIN_NAME}_SOURCE_DIR})
79+
include_directories( ${PLUGINS_SOURCE_DIR} )
80+
include_directories( ${PLUGINS_BINARY_DIR} )
81+
82+
# ******************************************************************************
83+
# Create our custom executable that will generate most of our QFilterWidget
84+
# classes from information stored in the Filters themselves.
85+
# Read the file back into a string so we can configure our file
86+
file(READ ${FilterWidget_GEN_HDRS_File} ${PLUGIN_NAME}Widget_GEN_HDRS)
87+
file(READ ${FilterWidget_GEN_SRCS_File} ${PLUGIN_NAME}Widget_GEN_SRCS)
88+
89+
# Remove the temp files that we no longer need
90+
file(REMOVE ${FilterWidget_GEN_HDRS_File})
91+
file(REMOVE ${FilterWidget_GEN_SRCS_File})
92+
93+
94+
set(FILTER_HEADERS "#include \"${AllFiltersHeaderFile}\"")
95+
set(FILTER_WIDGETS_TEMP_DIR ${${PLUGIN_NAME}_BINARY_DIR}/Temp)
96+
set(FILTER_WIDGETS_BINARY_DIR ${${PLUGIN_NAME}_BINARY_DIR})
97+
set(FILTER_WIDGETS_SOURCE_DIR ${${PLUGIN_NAME}_SOURCE_DIR})
98+
set(FILTER_WIDGETS_DOCS_DIR ${${PLUGIN_NAME}_SOURCE_DIR}/Documentation/Filters)
99+
set(FILTER_INCLUDE_PREFIX "${PLUGIN_NAME}")
100+
101+
# --------------------------------------------------------------------
102+
# On Linux we need -fPIC for linking static and shared libraries
103+
if(UNIX AND NOT APPLE)
104+
set_source_files_properties(${${PLUGIN_NAME}_Project_SRCS} PROPERTIES COMPILE_FLAGS -fPIC)
105+
endif()
106+
107+
# --------------------------------------------------------------------
108+
# These headers will be MOC'ed by the build system. They should all inherit from QObject
109+
# --------------------------------------------------------------------
110+
set(${PLUGIN_NAME}_HDRS
111+
${PROJECT_SOURCE_DIR}/${PLUGIN_NAME}Plugin.h
112+
${PROJECT_SOURCE_DIR}/${PLUGIN_NAME}Constants.h
113+
)
114+
115+
set(${PLUGIN_NAME}_SRCS
116+
${PROJECT_SOURCE_DIR}/${PLUGIN_NAME}Plugin.cpp
117+
)
118+
119+
set(${PLUGIN_NAME}_MISC_HDRS
120+
${PROJECT_SOURCE_DIR}/${PLUGIN_NAME}Constants.h
121+
)
122+
cmp_IDE_SOURCE_PROPERTIES( "${PLUGIN_NAME}/" "${${PLUGIN_NAME}_HDRS};${${PLUGIN_NAME}_MISC_HDRS}" "${${PLUGIN_NAME}_SRCS}" "0")
123+
124+
# -----------------------------------------------------------------------------
125+
# Collect all of our Generated header and source files so that they show up in the various projects
126+
set(${PLUGIN_NAME}_GEN_HDRS
127+
${AllFiltersHeaderFile}
128+
${RegisterKnownFiltersFile}
129+
${AllFilterParameterWidgetsHeaderFile}
130+
${RegisterKnownFilterParameterWidgetsFile}
131+
)
132+
133+
# --------------------------------------------------------------------
134+
#
135+
# --------------------------------------------------------------------
136+
set_source_files_properties( ${${PLUGIN_NAME}_MODULE_MOC_SRCS} PROPERTIES HEADER_FILE_ONLY TRUE)
137+
set_source_files_properties( ${RegisterKnownFiltersFile} PROPERTIES HEADER_FILE_ONLY TRUE)
138+
set_source_files_properties( ${RegisterKnownFilterParameterWidgetsFile} PROPERTIES HEADER_FILE_ONLY TRUE)
139+
140+
# --------------------------------------------------------------------
141+
# Group all the generated source files in IDE's that support it. Makes it clear
142+
# to the user of the IDE what is generated and what is not.
143+
cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Moc" "${${PLUGIN_NAME}_GEN_HDRS}" "${${PLUGIN_NAME}_Generated_MOC_SRCS};${${PLUGIN_NAME}_MOC_SRCS};${${PLUGIN_NAME}_GEN_SRCS}" "0")
144+
cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Uic" "${${PLUGIN_NAME}_Generated_UI_HDRS}" "" "0")
145+
cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Qrc" "${${PLUGIN_NAME}_Generated_RC_SRCS}" "" "0")
146+
147+
148+
# --------------------------------------------------------------------
149+
#
150+
# --------------------------------------------------------------------
151+
include(${ZeissImport_SOURCE_DIR}/ZeissXml/SourceList.cmake)
152+
153+
154+
# --------------------------------------------------------------------
155+
#
156+
# --------------------------------------------------------------------
157+
set(${PLUGIN_NAME}_MODULE_SRCS
158+
${${PLUGIN_NAME}_Project_SRCS} # These sources come from the SourceList.cmake file and include .h/.cpp/moc/uic files
159+
${${PLUGIN_NAME}_HDRS}
160+
${${PLUGIN_NAME}_SRCS}
161+
${${PLUGIN_NAME}_MODULE_MOC_SRCS}
162+
${${PLUGIN_NAME}_MISC_HDRS}
163+
# -- Add in the Filter Parameter Widgets
164+
${${PLUGIN_NAME}_ParameterWidgets_HDRS}
165+
${${PLUGIN_NAME}_ParameterWidgets_SRCS}
166+
${${PLUGIN_NAME}_ParameterWidgets_UIS}
167+
${${PLUGIN_NAME}_ParameterWidgets_Generated_MOC_SRCS}
168+
${${PLUGIN_NAME}_ParameterWidgets_Generated_UI_HDRS}
169+
# -- Add in the plain Widgets
170+
${${PLUGIN_NAME}_Widgets_HDRS}
171+
${${PLUGIN_NAME}_Widgets_SRCS}
172+
${${PLUGIN_NAME}_Widgets_UIS}
173+
${${PLUGIN_NAME}_Widgets_Generated_MOC_SRCS}
174+
${${PLUGIN_NAME}_Widgets_Generated_UI_HDRS}
175+
${${PLUGIN_NAME}_GEN_HDRS}
176+
${ZeissXml_SRCS}
177+
${ZeissXml_HDRS}
178+
)
179+
180+
# --------------------------------------------------------------------
181+
# Setup output Directory for the plugin
182+
if(NOT MSVC)
183+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${DREAM3DProj_BINARY_DIR}/Bin/Plugins )
184+
endif()
185+
186+
187+
188+
add_library(${PLUGIN_NAME} MODULE ${${PLUGIN_NAME}_MODULE_SRCS})
189+
target_link_libraries(${PLUGIN_NAME}
190+
${QT_QTCORE_LIBRARY}
191+
DREAM3DLib
192+
${QT_QTGUI_LIBRARY}
193+
QtSupport
194+
DREAM3DWidgetsLib
195+
${QT_QTXML_LIBRARY}
196+
)
197+
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES FOLDER ${PLUGIN_NAME}Plugin)
198+
199+
# --------------------------------------------------------------------
200+
# Set some additional properties of the plugin like its output name
201+
PluginProperties(${PLUGIN_NAME} "_debug" "${DREAM3D_VERSION}"
202+
"${DREAM3D_BINARY_DIR}" "${CMP_PLUGIN_LIST_FILE}")
203+
204+
205+
# --------------------------------------------------------------------
206+
# Put back the output directory
207+
if(NOT MSVC)
208+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${DREAM3DProj_BINARY_DIR}/Bin )
209+
endif()
210+
211+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
ZeissImportFilter {#zeissimportfilter}
2+
=====
3+
4+
## Group (Subgroup) ##
5+
ZeissImport (ZeissImport)
6+
7+
8+
## Description ##
9+
This filter does the following...
10+
11+
## Parameters ##
12+
| Name | Type |
13+
|------------------|------|
14+
| Feature Array Name | String |
15+
16+
## Required Arrays ##
17+
18+
| Type | Default Array Name | Description | Comment |
19+
|------|--------------------|-------------|---------|
20+
| Int | SomeName | .... | other |
21+
22+
23+
## Created Arrays ##
24+
25+
| Type | Default Array Name | Description | Comment |
26+
|------|--------------------|-------------|---------|
27+
| Int | SomeName | .... | other |
28+
29+
30+
31+
## Authors: ##
32+
33+
**Copyright:** Who holds the copyright for the code
34+
35+
**Contact Info:** email address
36+
37+
**Version:** x.y.z
38+
39+
**License:** What is the license for this code
40+
41+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
set(${PLUGIN_NAME}_ParameterWidgets_HDRS "")
3+
set(${PLUGIN_NAME}_ParameterWidgets_SRCS "")
4+
set(${PLUGIN_NAME}_ParameterWidgets_UIS "")
5+
6+
# --------------------------------------------------------------------
7+
# List the name of your custom FilterParameter Widgets in this section
8+
set(${PLUGIN_NAME}_PARAMETER_WIDGETS
9+
# SomeCustomWidget
10+
)
11+
12+
# --------------------------------------------------------------------
13+
# Create a File that has all the headers for the various Filter Parameter Widgets
14+
set(AllFilterParameterWidgetsHeaderFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/FilterParameterWidgets.h_tmp)
15+
file(WRITE ${AllFilterParameterWidgetsHeaderFile} "#ifndef _${PLUGIN_NAME}_FilterParameterWidgets_H_\n#define _${PLUGIN_NAME}_FilterParameterWidgets_H_\n\n")
16+
# --------------------------------------------------------------------
17+
# Create a File that will register all of the DREAM3D Filter Parameter Widgets
18+
set(RegisterKnownFilterParameterWidgetsFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/RegisterKnownFilterParameterWidgets.cpp_tmp)
19+
file(WRITE ${RegisterKnownFilterParameterWidgetsFile} "/* This file was AUTO GENERATED During the CMake Run. DO NOT EDIT THIS FILE. Edit the CMake files that generate this file */\n")
20+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "/* The CMake code that generates this file is located in ${CMAKE_CURRENT_LIST_FILE}*/\n")
21+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "/* This file will be directly included in another source file. */\n")
22+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "#include \"DREAM3DWidgetsLib/FilterWidgetManager.h\"\n")
23+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "#include \"DREAM3DWidgetsLib/PipelineFilterWidgetFactory.hpp\"\n")
24+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "#include \"${PLUGIN_NAME}/FilterParameterWidgets/FilterParameterWidgets.h\"\n\n")
25+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "\nvoid ${PLUGIN_NAME}Plugin::registerFilterWidgets(FilterWidgetManager* idManager)\n{\n")
26+
27+
28+
# --------------------------------------------------------------------
29+
# Loop through all the FilterParameterWidgets that this plugin is going to compile and make available.
30+
foreach(FPW ${${PLUGIN_NAME}_PARAMETER_WIDGETS})
31+
set(${PLUGIN_NAME}_ParameterWidgets_HDRS
32+
${${PLUGIN_NAME}_ParameterWidgets_HDRS}
33+
${${PLUGIN_NAME}_SOURCE_DIR}/FilterParameterWidgets/${FPW}.h
34+
)
35+
set(${PLUGIN_NAME}_ParameterWidgets_SRCS
36+
${${PLUGIN_NAME}_ParameterWidgets_SRCS}
37+
${${PLUGIN_NAME}_SOURCE_DIR}/FilterParameterWidgets/${FPW}.cpp
38+
)
39+
set(${PLUGIN_NAME}_ParameterWidgets_UIS
40+
${${PLUGIN_NAME}_ParameterWidgets_UIS}
41+
${${PLUGIN_NAME}_SOURCE_DIR}/FilterParameterWidgets/UI_Files/${FPW}.ui
42+
)
43+
44+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} " {\n")
45+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} " PipelineFilterWidgetFactory<${FPW}>::Pointer factory = PipelineFilterWidgetFactory<${FPW}>::New();\n")
46+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} " idManager->addFilterWidgetFactory( \"${FPW}\", factory );\n")
47+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} " }\n")
48+
file(APPEND ${AllFilterParameterWidgetsHeaderFile} "#include \"${PLUGIN_NAME}/FilterParameterWidgets/${FPW}.h\"\n")
49+
endforeach()
50+
51+
52+
53+
# --------------------------------------------------------------------
54+
# Close off the files with the proper C++
55+
file(APPEND ${AllFilterParameterWidgetsHeaderFile} "\n#endif\n")
56+
file(APPEND ${RegisterKnownFilterParameterWidgetsFile} "}\n")
57+
58+
cmpReplaceFileIfDifferent(OLD_FILE_PATH ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/FilterParameterWidgets.h
59+
NEW_FILE_PATH ${AllFilterParameterWidgetsHeaderFile} )
60+
cmpReplaceFileIfDifferent(OLD_FILE_PATH ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/RegisterKnownFilterParameterWidgets.cpp
61+
NEW_FILE_PATH ${RegisterKnownFilterParameterWidgetsFile} )
62+
set(AllFilterParameterWidgetsHeaderFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/FilterParameterWidgets.h)
63+
set(RegisterKnownFilterParameterWidgetsFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/RegisterKnownFilterParameterWidgets.cpp)
64+
65+
66+
cmp_IDE_SOURCE_PROPERTIES( "${PLUGIN_NAME}/FilterParameterWidgets" "${${PLUGIN_NAME}_ParameterWidgets_HDRS}" "${${PLUGIN_NAME}_ParameterWidgets_SRCS}" "0")
67+
68+
cmp_IDE_GENERATED_PROPERTIES("${PLUGIN_NAME}/FilterParameterWidgets/UI_Files" "${${PLUGIN_NAME}_ParameterWidgets_UIS}" "")
69+
70+
# --------------------------------------------------------------------
71+
# and finally this will run moc:
72+
#QT4_WRAP_CPP( ${PLUGIN_NAME}_ParameterWidgets_Generated_MOC_SRCS ${${PLUGIN_NAME}_ParameterWidgets_HDRS} )
73+
74+
# These generated moc files will be #include in the FilterWidget source file that
75+
# are generated so we need to tell the build system to NOT compile these files
76+
set_source_files_properties( ${${PLUGIN_NAME}_ParameterWidgets_Generated_MOC_SRCS} PROPERTIES HEADER_FILE_ONLY TRUE)
77+
78+
# -- Run MOC and UIC on the necessary files
79+
# QT4_ADD_RESOURCES( ${PLUGIN_NAME}_Generated_RC_SRCS "${DREAM3DProj_SOURCE_DIR}/Documentation/Filters/Generated_FilterDocs.qrc" )
80+
81+
# --------------------------------------------------------------------
82+
# Continue on with our Qt4 section
83+
QT4_WRAP_UI( ${PLUGIN_NAME}_ParameterWidgets_Generated_UI_HDRS ${${PLUGIN_NAME}_ParameterWidgets_UIS} )
84+
85+
# --------------------------------------------------------------------
86+
#-- Put the Qt generated files into their own group for IDEs
87+
cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Moc" "" "${${PLUGIN_NAME}_ParameterWidgets_Generated_MOC_SRCS}" "0")
88+
cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Uic" "${${PLUGIN_NAME}_ParameterWidgets_Generated_UI_HDRS}" "" "0")
89+
#cmp_IDE_SOURCE_PROPERTIES( "Generated/Qt_Qrc" "${${PLUGIN_NAME}_Generated_RC_SRCS}" "" "0")
90+
91+
92+
93+

0 commit comments

Comments
 (0)