Skip to content

Commit

Permalink
moved files and sub-directories from src to more logical destinations
Browse files Browse the repository at this point in the history
- moved scripts and *txt files one level up
- moved samples, examples and samples/PET_simulation to new sub-dir examples in the top-level directory
- created CMakeLists.txt in top-level directory (and moved PROJECT and other main statements there from src/CMakeLists.txt).
- moved CMake helper files to src/cmake, adjust many CMakeLists.txt to rely on module path for these files (by no longer specifying location using paths)
  • Loading branch information
KrisThielemans committed Mar 17, 2014
1 parent d6f78bf commit 23a68bb
Show file tree
Hide file tree
Showing 117 changed files with 119 additions and 133 deletions.
33 changes: 33 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,33 @@
# This file is part of STIR.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# See STIR/LICENSE.txt for details

# cmake file for building STIR. See the STIR User's Guide and http://www.cmake.org.

# avoid warning about WIN32 no longer defined in CYGWIN
set(CMAKE_LEGACY_CYGWIN_WIN32 0)

PROJECT(STIR)

SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# require 2.8.3 to get FOLDER properties support (without that, we only need cmake 2.6)
cmake_minimum_required(VERSION 2.8.3)

# add project source to cmake path such that it can use our find_package modules and .cmake files
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/src/cmake)

#### enable support for ctest
ENABLE_TESTING()

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(scripts)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 22 additions & 6 deletions documentation/release_3.0.htm
@@ -1,11 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Summary of changes in STIR release 3.0 alpha (dated 13/01/2014)</title>
<title>Summary of changes in STIR release 3.0 beta (dated 17/03/2014)</title>
</head>

<body>
<h1>Summary of changes in STIR release 3.0 alpha (dated 13/01/2014)</h1>
<h1>Summary of changes in STIR release 3.0 beta (dated 17/03/2014)</h1>

<p>This version is almost backwards compatible with STIR 2.4 for the user (see below), but <strong>not for
developers</strong>. Required code changes are minor however and detailed below.
Expand Down Expand Up @@ -83,6 +83,15 @@ <h3>Changes that break backwards compatibility</h3>
</li>
</ul>

<h3>New directory structure</h3>
<ul>
<li>Top-level directories are now <tt>src</tt>, <tt>scripts</tt>, <tt>examples</tt>, <tt>documentation</tt>, <tt>doximages</tt>. The <tt>samples</tt> directory is now a
sub-directory of <tt>examples</tt>, and the old <tt>examples</tt> is now
<tt>examples/src</tt>.</li>
<li><tt>recon_test_pack</tt> and <tt>documentation</tt> are now distributed in
zip files that unpack as <tt>STIR/recon_test_pack</tt> and <tt>STIR/documentation</tt>.</li>
</ul>

<h3>New functionality</h3>
<ul>
<li> new projection matrix for SPECT (called <code>SPECT UB</code>) supporting parallel hole collimators
Expand All @@ -103,7 +112,7 @@ <h3>New functionality</h3>
<li>The <tt>list_projdata_info</tt> utilities has an extra option <tt>--exam</tt> to
list some exam information (patient position and timing).
</li>
<li>The distribution now includes sample scripts (in the <tt>samples</tt> folder)
<li>The distribution now includes sample scripts (in the <tt>examples/PET_simulation</tt> folder)
for simulating PET data, adding Poisson noise
and reconstructing the data.</li>
</ul>
Expand All @@ -130,7 +139,8 @@ <h3>Build system</h3>
for Visual Studio are no longer distributed. Hand-crafted Unix Makefiles are still there but
getting out-of date (no ITK for instance).
</li>
<li>compilation when using CMake is speeded-up a bit as dependencies of the tests on STIR libraries are reduced.</li>
<li>Compilation when using CMake is speeded-up a bit as dependencies of the tests on STIR libraries are reduced.</li>
<li>You should now point cmake to the STIR main directory, not <tt>STIR/src</tt>.
</ul>


Expand Down Expand Up @@ -211,7 +221,7 @@ <H2>What's new for developers (aside from what should be obvious

<h3>Major bugs fixed</h3>
<ul>
<li>none</li>
<li>see above</li>
</ul>

<h3>New functionality</h3>
Expand All @@ -236,7 +246,7 @@ <h3>New functionality</h3>
<li> removed <ocde>CListModeData::get_scan_start_time_in_secs_since_1970()</code>. Get it via its <code>ExamInfo</code>.</li>
</ul>
</li>
<li> Using the above changes, <code>LmToProjData</code> properly writes time frame information to the projection data.</li>
<li> using the above changes, <code>LmToProjData</code> properly writes time frame information to the projection data.</li>

<li>changes to <code>ProjDataInfoCylindrical</code> to allow different radii for different views, useful for SPECT (or an elliptical PET scanner?)</li>
</ul>
Expand Down Expand Up @@ -265,6 +275,12 @@ <h3>Build system</h3>
add_subdirectory(${STIR_LOCAL})
</code>
</li>
<li> All CMake help-fules have been moved to a spearate sub-directory <tt>src/cmake</tt> which is
added to the CMazke module path. That means that you should use them for instance as
<pre>
include(stir_lib_target)
</pre>
</li>
</ul>
</body>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,4 +9,4 @@ set(${dir_EXE_SOURCES}
)


include(../stir_exe_targets.cmake)
include(stir_exe_targets)
13 changes: 8 additions & 5 deletions src/examples/README.txt → examples/src/README.txt
Expand Up @@ -43,7 +43,7 @@ exe.mk
Supporting files
----------------
extra_dirs.mk
A sub-makefile that needs to be moved to STIR/local. This way, it
A sub-makefile that needs to be moved to STIR/src/local. This way, it
will be picked up by the Makefile. Its contents simply say
that there is an exe.mk sub-makefile in examples/.

Expand Down Expand Up @@ -73,13 +73,15 @@ small.*s

How to compile using the "hand-made" Makefiles
-----------------------------------------------
cp extra_dirs.mk ../local/
mkdir -p ../src/local
cp extra_dirs.mk ../src/local/
cd ..
make examples

How to compile using CMake (on Unix-type systems)
-----------------------------------------------
cp extra_stir_dirs.cmake ../local/
mkdir -p ../src/local
cp extra_stir_dirs.cmake ../src/local/
cd your-build-dir
# reconfigure your project
ccmake .
Expand All @@ -95,8 +97,8 @@ First you need to create some data.
#Generate an image
generate_image generate_image.par

#Generate projection data (you will have to answer questions by fwdtest)
fwdtest sino.hs small.hs image.hv
#Generate projection data
forward_project sino.hs image.hv small.hs

# Run the demos.
DEST=../opt
Expand Down Expand Up @@ -127,3 +129,4 @@ Good luck

Kris Thielemans
12 November 2004
(with minor updates until 2014)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/scripts/CMakeLists.txt → scripts/CMakeLists.txt
Expand Up @@ -30,7 +30,7 @@ set(${dir_scripts}



#include(../stir_test_exe_targets.cmake)
#include(stir_test_exe_targets)

install(PROGRAMS ${${dir_scripts}} DESTINATION bin)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 2 additions & 17 deletions src/CMakeLists.txt
Expand Up @@ -18,18 +18,6 @@

# cmake file for building STIR. See the STIR User's Guide and http://www.cmake.org.

# avoid warning about WIN32 no longer defined in CYGWIN
set(CMAKE_LEGACY_CYGWIN_WIN32 0)

PROJECT(STIR)

SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# require 2.8.3 to get FOLDER properties support (without that, we only need cmake 2.6)
cmake_minimum_required(VERSION 2.8.3)

# add project source to cmake path such that it can use our find_package modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)

option(STIR_MPI
Expand Down Expand Up @@ -162,15 +150,12 @@ if(STIR_OPENMP)

endif()

#### enable support for ctest
ENABLE_TESTING()

#### STIR library
include(stir_dirs.cmake)
include(stir_dirs)

# see if there's a local subdirectory.
if(NOT DISABLE_STIR_LOCAL)
find_path(STIR_LOCAL NAME "extra_stir_dirs.cmake" PATHS "${PROJECT_SOURCE_DIR}/local/" NO_DEFAULT_PATH)
find_path(STIR_LOCAL NAME "extra_stir_dirs.cmake" PATHS "${PROJECT_SOURCE_DIR}/src/local/" NO_DEFAULT_PATH)
if (STIR_LOCAL)
include(${STIR_LOCAL}/extra_stir_dirs.cmake)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/IO/CMakeLists.txt
Expand Up @@ -60,7 +60,7 @@ if(AVW_FOUND)
)
endif()

include(../stir_lib_target.cmake)
include(stir_lib_target)

if (LLN_FOUND)
target_link_libraries(IO ${LLN_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion src/Shape_buildblock/CMakeLists.txt
Expand Up @@ -15,6 +15,6 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:= $(dir)_registries

include(../stir_lib_target.cmake)
include(stir_lib_target)

target_link_libraries(Shape_buildblock buildblock IO )
2 changes: 1 addition & 1 deletion src/SimSET/CMakeLists.txt
Expand Up @@ -28,7 +28,7 @@ set(${dir_EXE_SOURCES}
conv_to_SimSET_att_image
)

include(../stir_exe_targets.cmake)
include(stir_exe_targets)

# stand-alone
add_executable(write_phg_image_info write_phg_image_info.c)
Expand Down
2 changes: 1 addition & 1 deletion src/SimSET/scripts/CMakeLists.txt
Expand Up @@ -32,7 +32,7 @@ stir_image_to_simset_object.sh
)


#include(../stir_test_exe_targets.cmake)
#include(stir_test_exe_targets)

install(PROGRAMS ${${dir_scripts}} DESTINATION bin)

4 changes: 2 additions & 2 deletions src/analytic/FBP2D/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:=

include(../../stir_lib_target.cmake)
include(stir_lib_target)
target_link_libraries(analytic_FBP2D recon_buildblock IO )

set (dir_EXE_SOURCES ${dir}_EXE_SOURCES)
Expand All @@ -21,4 +21,4 @@ set(${dir_EXE_SOURCES}
FBP2D
)

include(../../stir_exe_targets.cmake)
include(stir_exe_targets)
4 changes: 2 additions & 2 deletions src/analytic/FBP3DRP/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:=

include(../../stir_lib_target.cmake)
include(stir_lib_target)
target_link_libraries(analytic_FBP3DRP analytic_FBP2D recon_buildblock )

set (dir_EXE_SOURCES ${dir}_EXE_SOURCES)
Expand All @@ -21,5 +21,5 @@ set(${dir_EXE_SOURCES}
FBP3DRP
)

include(../../stir_exe_targets.cmake)
include(stir_exe_targets)

2 changes: 1 addition & 1 deletion src/buildblock/CMakeLists.txt
Expand Up @@ -75,7 +75,7 @@ if (NOT HAVE_SYSTEM_GETOPT)
list(APPEND ${dir_LIB_SOURCES} getopt)
endif()

include(../stir_lib_target.cmake)
include(stir_lib_target)

# TODO Remove but currently needed for ProjData.cxx, DynamicDisc*cxx, TimeFrameDef
if (LLN_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion src/FindAVW.cmake → src/cmake/FindAVW.cmake
Expand Up @@ -15,7 +15,7 @@
# message(STATUS "AVW_INCLUDE_DIRS ${AVW_INCLUDE_DIRS}")

find_library(AVW_LIBRARIES NAME AVW
HINTS ${AVW_ROOT_DIR}/$ENV(TARGET)/lib/
HINTS ${AVW_ROOT_DIR}/$ENV{TARGET}/lib/
DOC "location of AVW library")

# handle the QUIETLY and REQUIRED arguments and set AVW_FOUND to TRUE if
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 10 additions & 9 deletions src/stir_dirs.cmake → src/cmake/stir_dirs.cmake
Expand Up @@ -24,16 +24,18 @@


# add the STIR include directory to the search path for the compiler
include_directories ("${PROJECT_SOURCE_DIR}/include")
include_directories ("${PROJECT_SOURCE_DIR}/src/include")

SET( STIR_IO_REGISTRIES ${PROJECT_SOURCE_DIR}/src/IO/IO_registries.cxx)

SET ( STIR_REGISTRIES
${CMAKE_HOME_DIRECTORY}/buildblock/buildblock_registries.cxx
${CMAKE_HOME_DIRECTORY}/data_buildblock/data_buildblock_registries.cxx
${CMAKE_HOME_DIRECTORY}/IO/IO_registries.cxx
${CMAKE_HOME_DIRECTORY}/recon_buildblock/recon_buildblock_registries.cxx
${CMAKE_HOME_DIRECTORY}/Shape_buildblock/Shape_buildblock_registries.cxx
${CMAKE_HOME_DIRECTORY}/modelling_buildblock/modelling_registries.cxx
${CMAKE_HOME_DIRECTORY}/spatial_transformation_buildblock/spatial_transformation_registries.cxx
${PROJECT_SOURCE_DIR}/src/buildblock/buildblock_registries.cxx
${PROJECT_SOURCE_DIR}/src/data_buildblock/data_buildblock_registries.cxx
${STIR_IO_REGISTRIES}
${PROJECT_SOURCE_DIR}/src/recon_buildblock/recon_buildblock_registries.cxx
${PROJECT_SOURCE_DIR}/src/Shape_buildblock/Shape_buildblock_registries.cxx
${PROJECT_SOURCE_DIR}/src/modelling_buildblock/modelling_registries.cxx
${PROJECT_SOURCE_DIR}/src/spatial_transformation_buildblock/spatial_transformation_registries.cxx
)

SET( STIR_LIBRARIES analytic_FBP3DRP analytic_FBP2D iterative_OSMAPOSL
Expand Down Expand Up @@ -69,7 +71,6 @@ SET( STIR_DIRS
iterative/OSSPS
iterative/POSMAPOSL
iterative/POSSPS
scripts
SimSET
SimSET/scripts
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/data_buildblock/CMakeLists.txt
Expand Up @@ -34,6 +34,6 @@ if (HAVE_ECAT)
)
endif()

include(../stir_lib_target.cmake)
include(stir_lib_target)

target_link_libraries(${dir} buildblock)
2 changes: 1 addition & 1 deletion src/display/CMakeLists.txt
Expand Up @@ -42,7 +42,7 @@ else()
message(FATAL_ERROR "GRAPHICS has to be X, PGM or None")
endif()

include(../stir_lib_target.cmake)
include(stir_lib_target)

if( "${GRAPHICS}" STREQUAL "X")
find_package(Curses REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion src/eval_buildblock/CMakeLists.txt
Expand Up @@ -13,7 +13,7 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:= $(dir)_registries.cxx

include(../stir_lib_target.cmake)
include(stir_lib_target)

target_link_libraries(eval_buildblock buildblock )

Expand Down
4 changes: 2 additions & 2 deletions src/iterative/OSMAPOSL/CMakeLists.txt
Expand Up @@ -9,15 +9,15 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:=

include(${PROJECT_SOURCE_DIR}/stir_lib_target.cmake)
include(stir_lib_target)

set (dir_EXE_SOURCES ${dir}_EXE_SOURCES)

set(${dir_EXE_SOURCES}
OSMAPOSL
)

include(../../stir_exe_targets.cmake)
include(stir_exe_targets)

if (STIR_MPI)
SET_PROPERTY(TARGET OSMAPOSL PROPERTY LINK_FLAGS ${MPI_CXX_LINK_FLAGS})
Expand Down
4 changes: 2 additions & 2 deletions src/iterative/OSSPS/CMakeLists.txt
Expand Up @@ -9,7 +9,7 @@ set(${dir_LIB_SOURCES}

#$(dir)_REGISTRY_SOURCES:=

include(${PROJECT_SOURCE_DIR}/stir_lib_target.cmake)
include(stir_lib_target)

set (dir_EXE_SOURCES ${dir}_EXE_SOURCES)

Expand All @@ -18,7 +18,7 @@ set(${dir_EXE_SOURCES}
)


include(../../stir_exe_targets.cmake)
include(stir_exe_targets)

if (STIR_MPI)
SET_PROPERTY(TARGET OSSPS PROPERTY LINK_FLAGS ${MPI_CXX_LINK_FLAGS})
Expand Down
2 changes: 1 addition & 1 deletion src/iterative/POSMAPOSL/CMakeLists.txt
Expand Up @@ -26,4 +26,4 @@ set(${dir_EXE_SOURCES}
POSMAPOSL
)

include(../../stir_exe_targets.cmake)
include(stir_exe_targets)

0 comments on commit 23a68bb

Please sign in to comment.