<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>Hi Inge,</p>
    <p><br>
    </p>
    <p>I am not sure about what you mean by moving along the
      deformations.<br>
    </p>
    <p>- With involuntary patient motion (-im), a sensitivity image is
      computed for each subset of data between motion triggers. If an
      attenuation image is provided, it is transformed using the
      "forward" deformation parameters. They are then transformed back
      to the reference position, and receive the proper weighing before
      being merged together (finally you get one sensitivity image by
      frame, or just one image if you don't have any frame).</p>
    <p>- The process is similar with motion correction for gating. One
      sensitivity image is computed for each set of transformation
      parameters (i.e, each gate), then they are deformed back into the
      reference position and merged together.</p>
    <p><br>
    </p>
    <p>During reconstruction, these sensitivity images are always used
      on images transformed back in the reference position.<br>
    </p>
    <p><br>
    </p>
    <p>I hope this helps to clarify the process.<br>
    </p>
    <p><br>
    </p>
    <p>Thibaut<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 22/09/2020 18:44, Schagt, I.H. van
      der wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:baba64b1f12a46e4a4ef834875583395@umcutrecht.nl">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <meta content="text/html; charset=UTF-8">
      <style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
      <div dir="ltr">
        <div id="x_divtagdefaultwrapper" dir="ltr"
          style="font-size:12pt; color:#000000;
          font-family:Calibri,Helvetica,sans-serif">
          <p>Hello Thibaut,</p>
          <p><br>
          </p>
          <p>You are totally right, I enabled
            CASToR_BUILD_SAMPLE_UTILITIES in Cmake and that worked. I
            can now build the projects and do reconstructions.</p>
          <p><br>
          </p>
          <p>Lastly, I noticed one more thing. When I reconstruct images
            with the -im option and I use attenuation correction, the
            attenuation map doesn't move along with the deformations,
            while this was the case for the -rm option (respiratory
            motion). </p>
          <p>Is this the intention and/or is it possible to let the
            attenuation map move along with the deformations?</p>
          <p><br>
          </p>
          <p>Above all, many thanks for your help!</p>
          <p><br>
          </p>
          <p>Inge</p>
        </div>
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
            face="Calibri, sans-serif" color="#000000"><b>Van:</b>
            Castor-users
            <a class="moz-txt-link-rfc2396E" href="mailto:castor-users-bounces@lists.castor-project.org"><castor-users-bounces@lists.castor-project.org></a> namens
            <a class="moz-txt-link-abbreviated" href="mailto:castor-users-request@lists.castor-project.org">castor-users-request@lists.castor-project.org</a>
            <a class="moz-txt-link-rfc2396E" href="mailto:castor-users-request@lists.castor-project.org"><castor-users-request@lists.castor-project.org></a><br>
            <b>Verzonden:</b> dinsdag 22 september 2020 10:24:31<br>
            <b>Aan:</b> <a class="moz-txt-link-abbreviated" href="mailto:castor-users@lists.castor-project.org">castor-users@lists.castor-project.org</a><br>
            <b>Onderwerp:</b> Castor-users Digest, Vol 36, Issue 13</font>
          <div> </div>
        </div>
      </div>
      <font size="2"><span style="font-size:10pt;">
          <div class="PlainText">Send Castor-users mailing list
            submissions to<br>
                    <a class="moz-txt-link-abbreviated" href="mailto:castor-users@lists.castor-project.org">castor-users@lists.castor-project.org</a><br>
            <br>
            To subscribe or unsubscribe via the World Wide Web, visit<br>
                    <a
              href="http://lists.castor-project.org/listinfo/castor-users"
              moz-do-not-send="true">http://lists.castor-project.org/listinfo/castor-users</a><br>
            or, via email, send a message with subject or body 'help' to<br>
                    <a class="moz-txt-link-abbreviated" href="mailto:castor-users-request@lists.castor-project.org">castor-users-request@lists.castor-project.org</a><br>
            <br>
            You can reach the person managing the list at<br>
                    <a class="moz-txt-link-abbreviated" href="mailto:castor-users-owner@lists.castor-project.org">castor-users-owner@lists.castor-project.org</a><br>
            <br>
            When replying, please edit your Subject line so it is more
            specific<br>
            than "Re: Contents of Castor-users digest..."<br>
            <br>
            <br>
            Today's Topics:<br>
            <br>
               1. Re:  Problems with –im (involuntary patient motion<br>
                  correction) (tmerlin)<br>
            <br>
            <br>
----------------------------------------------------------------------<br>
            <br>
            Message: 1<br>
            Date: Tue, 22 Sep 2020 10:24:50 +0200<br>
            From: tmerlin <a class="moz-txt-link-rfc2396E" href="mailto:Thibaut.Merlin@univ-brest.fr"><Thibaut.Merlin@univ-brest.fr></a><br>
            To: <a class="moz-txt-link-abbreviated" href="mailto:castor-users@lists.castor-project.org">castor-users@lists.castor-project.org</a><br>
            Subject: Re: [Castor-users]  Problems with –im (involuntary
            patient<br>
                    motion correction)<br>
            Message-ID:
            <a class="moz-txt-link-rfc2396E" href="mailto:6cf8c8f2-aceb-39d4-65d8-d620386cd9d2@univ-brest.fr"><6cf8c8f2-aceb-39d4-65d8-d620386cd9d2@univ-brest.fr></a><br>
            Content-Type: text/plain; charset="windows-1252";
            Format="flowed"<br>
            <br>
            <br>
            Hi Inge,<br>
            <br>
            <br>
            The building problem might come from the CMake configuration
            file, as <br>
            these projects have been relocated (now you must enable <br>
            CASToR_BUILD_SAMPLE_UTILITIES in cmake to build them). It
            should not <br>
            have caused issues to build the solution though, so I will
            have a closer <br>
            look at it.<br>
            <br>
            <br>
            Could you try to rebuild the 3.1 version with <br>
            CASToR_BUILD_SAMPLE_UTILITIES enabled ? Alternatively if
            there are still <br>
            some issues, you can use the configuration file from the
            previous <br>
            version in attachements (to replace the one in the castor
            directory).<br>
            <br>
            <br>
            Let me know if this helps<br>
            <br>
            <br>
            Kind regards,<br>
            <br>
            Thibaut<br>
            <br>
            <br>
            <br>
            On 22/09/2020 09:41, Schagt, I.H. van der wrote:<br>
            ><br>
            > Dear Zacharis,<br>
            ><br>
            ><br>
            > Thank you for your quick response.<br>
            ><br>
            > As for oDynamicDataManager, in the datafile header a
            start time and <br>
            > duration are indeed given, these are 0s and 900s
            respectively. even <br>
            > though these values are included, the frame time stop
            remains 0s when <br>
            > I apply motion correction without framing.<br>
            ><br>
            > I tried the new version of Castor (V3.1), but I have
            trouble with <br>
            > configuring and building te program. Configuring only
            creates four <br>
            > projects in the solution (all_build, *castor-recon*,
            install and <br>
            > zero_check) instead of seven projects (all_build,
            *castor-recon*, <br>
            > install, zero_check, *castor-datafileExplorer, <br>
            > castor-imageDynamicTools and
            castor-scannerLUTExplorer*) and this <br>
            > causes problems building the solution.<br>
            ><br>
            > As far as configuring and building is concerned, I did
            everything the <br>
            > same as with v_3.0.1. I configured Castor with CMake
            and tried to <br>
            > build it in Windows Visual Studio.<br>
            ><br>
            > Do you know if the problem with configuring and
            building could be with <br>
            > this new version?<br>
            ><br>
            ><br>
            > Kind regards,<br>
            ><br>
            > Inge<br>
            ><br>
            >
            ------------------------------------------------------------------------<br>
            > *Van:* Chalampalakis, Zacharias
            <a class="moz-txt-link-rfc2396E" href="mailto:zacharias.chalampalakis@kcl.ac.uk"><zacharias.chalampalakis@kcl.ac.uk></a><br>
            > *Verzonden:* maandag 21 september 2020 18:21:32<br>
            > *Aan:* Schagt, I.H. van der;
            <a class="moz-txt-link-abbreviated" href="mailto:castor-users@lists.castor-project.org">castor-users@lists.castor-project.org</a><br>
            > *Onderwerp:* RE: Problems with –im (involuntary patient
            motion <br>
            > correction)<br>
            ><br>
            > Good afternoon Igne<br>
            ><br>
            > Thank you for your email.<br>
            ><br>
            > We actually just released a new version of CASToR (
            V3.1 ) which fixed <br>
            > some bugs related to the handling of motion timestamps.<br>
            ><br>
            > Maybe you could try with this version , if it is not
            too difficult , <br>
            > to check if the behaviour you experience is related to
            these bugs ?<br>
            ><br>
            > In the latest version , the /oDynamidDataManager/ will
            remove all <br>
            > timestamps that occur after the end of the last frame.<br>
            ><br>
            > Normally the duration of the frame ( even when not
            specifying framing <br>
            > ) is set by the *Start time (s) *and *Duration (s)
            *entries in the <br>
            > datafile header.<br>
            ><br>
            > Do you have these entries in your datafile header?<br>
            ><br>
            > Kind Regards,<br>
            ><br>
            > Zacharias Chalampalakis<br>
            ><br>
            > *From:*Castor-users
            <a class="moz-txt-link-rfc2396E" href="mailto:castor-users-bounces@lists.castor-project.org"><castor-users-bounces@lists.castor-project.org></a> <br>
            > *On Behalf Of *Schagt, I.H. van der<br>
            > *Sent:* Monday, September 21, 2020 4:33 PM<br>
            > *To:* <a class="moz-txt-link-abbreviated" href="mailto:castor-users@lists.castor-project.org">castor-users@lists.castor-project.org</a><br>
            > *Subject:* [Castor-users] Problems with –im
            (involuntary patient <br>
            > motion correction)<br>
            ><br>
            > Dear all,<br>
            ><br>
            > I am having trouble with motion correction
            reconstruction when using <br>
            > the –im option. When I try to apply motion correction
            reconstruction I <br>
            > get the error:<br>
            ><br>
            > /Error, the 2th motion trigger timestamp: xxx occurs
            after the end of <br>
            > the last frame (frame 1, timestop: 0!/<br>
            ><br>
            > This error occurs in the code in the file
            /oDynamicDataManager/ line <br>
            > 413 and arises incorrectly. When I do –im
            reconstruction in <br>
            > combination with 1 frame (so no framing), the time stop
            value of the <br>
            > frame remains 0s, it is not read from the data file. As
            a result, the <br>
            > time steps of the motion triggers are greater than the
            time stop value <br>
            > of the frame (line 407) and you will eventually get an
            error. When I <br>
            > manually adjust this time stop value to the correct
            value myself, this <br>
            > error message goes away, but I get incorrect
            reconstructed images. I <br>
            > only get black images after reconstruction where each
            voxel has NaN as <br>
            > its value. When I apply the same motion correction
            where I also divide <br>
            > the data into, for example, 2 frames (-frm…), I get
            correctly <br>
            > reconstructed images.<br>
            ><br>
            > Does anyone of you know why the option –im gives these
            weird results, <br>
            > or what I maybe do wrong?<br>
            > I use list-mode PET data with a total duration of 900
            seconds. For the <br>
            > motion correction, I used three motion triggers (and
            deformations).<br>
            ><br>
            > Thanks in advance!<br>
            ><br>
            > Inge<br>
            ><br>
            >
            ------------------------------------------------------------------------<br>
            ><br>
            > /De informatie opgenomen in dit bericht kan
            vertrouwelijk zijn en is <br>
            > uitsluitend bestemd voor de geadresseerde. Indien u dit
            bericht <br>
            > onterecht ontvangt, wordt u verzocht de inhoud niet te
            gebruiken en de <br>
            > afzender direct te informeren door het bericht te
            retourneren. Het <br>
            > Universitair Medisch Centrum Utrecht is een
            publiekrechtelijke <br>
            > rechtspersoon in de zin van de W.H.W. (Wet Hoger
            Onderwijs en <br>
            > Wetenschappelijk Onderzoek) en staat geregistreerd bij
            de Kamer van <br>
            > Koophandel voor Midden-Nederland onder nr. 30244197. /<br>
            ><br>
            > /Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
            /<br>
            ><br>
            >
            ------------------------------------------------------------------------<br>
            ><br>
            > /This message may contain confidential information and
            is intended <br>
            > exclusively for the addressee. If you receive this
            message <br>
            > unintentionally, please do not use the contents but
            notify the sender <br>
            > immediately by return e-mail. University Medical Center
            Utrecht is a <br>
            > legal person by public law and is registered at the
            Chamber of <br>
            > Commerce for Midden-Nederland under no. 30244197. /<br>
            ><br>
            > /Please consider the environment before printing this
            e-mail. /<br>
            ><br>
            ><br>
            > _______________________________________________<br>
            > Castor-users mailing list<br>
            > <a class="moz-txt-link-abbreviated" href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a><br>
            > <a
              href="http://lists.castor-project.org/listinfo/castor-users"
              moz-do-not-send="true">http://lists.castor-project.org/listinfo/castor-users</a><br>
            <br>
            -- <br>
            Thibaut MERLIN -- PhD<br>
            <br>
            Docteur en Imagerie Médicale au Laboratoire de Traitement de
            l'Information Medicale (LaTIM - INSERM UMR 1101)<br>
            Institut Brestois de recherche en Bio-Santé (IBRBS)<br>
            12 Avenue Foch, 29200 Brest, FRANCE<br>
            Tel: 06.75.12.24.90<br>
            <br>
            -------------- next part --------------<br>
            An HTML attachment was scrubbed...<br>
            URL: <<a
href="http://lists.castor-project.org/pipermail/castor-users/attachments/20200922/6a9155da/attachment.html"
              moz-do-not-send="true">http://lists.castor-project.org/pipermail/castor-users/attachments/20200922/6a9155da/attachment.html</a>><br>
            -------------- next part --------------<br>
            # MON 1 Aug 2016 17:02 PM CET<br>
            # Didier Benoit,  <a class="moz-txt-link-abbreviated" href="mailto:didier.benoit13@gmail.com">didier.benoit13@gmail.com</a><br>
            # Thibaut Merlin, <a class="moz-txt-link-abbreviated" href="mailto:thibaut.merlin@gmail.com">thibaut.merlin@gmail.com</a><br>
            # CMAKE compiling the CASToR reconstruction software<br>
            <br>
            #---------<br>
            # Checking the CMAKE version<br>
            cmake_minimum_required( VERSION 2.8 FATAL_ERROR )<br>
            <br>
            #---------<br>
            # Set the build type<br>
            set( CMAKE_BUILD_TYPE "Release" CACHE STRING<br>
              "Choose the type of build, options are: Debug Release"<br>
            )<br>
            <br>
            #---------<br>
            # Defining the project<br>
            project( CASToR )<br>
            set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake-modules<br>
              ${CMAKE_MODULE_PATH}<br>
            )<br>
            <br>
            #---------<br>
            # Defining a list of option<br>
            option( CASToR_64bits "Build CASToR on 64 bits architecture"
            YES )<br>
            option( CASToR_VERBOSE "Print lot of infos from CASToR" NO )<br>
            option( CASToR_DEBUG "Enable many additionnal checks in
            primitive functions" NO )<br>
            option( CASToR_BUILD_GATE_UTILITIES "Build GATE tools for
            CASToR (require ROOT library)" NO )<br>
            option( CASToR_BUILD_SAMPLE_UTILITIES "Build Example codes
            (require ROOT library)" NO )<br>
            option( CASToR_BUILD_DEVEL "Build devel tools. Must be left
            unchecked" NO )<br>
            option( CASToR_ROOT "Build CASToR with ROOT library" NO )<br>
            option( CASToR_SIMD "Build CASToR with SIMD OPTION" NO )<br>
            option( CASToR_OMP "Build CASToR with OMP" NO )<br>
            option( CASToR_MPI "Build CASToR with MPI" NO )<br>
            # For testing purposes<br>
            #option( CASToR_DEFORMATION_LEDESMA "Build CASToR with
            LEDESMA" NO )<br>
            #option( CASToR_ELASTIX "Build CASToR with ELASTIX" NO )<br>
            <br>
            <br>
            #---------<br>
            # Find the config file CASToR config<br>
            find_path( CASTOR_CONFIG_DIR oCASToRConfig.hh.in<br>
              ${PROJECT_SOURCE_DIR}<br>
              ${PROJECT_SOURCE_DIR}/include/algorithm<br>
              ${PROJECT_SOURCE_DIR}/include/analytic_simulator<br>
              ${PROJECT_SOURCE_DIR}/include/datafile<br>
              ${PROJECT_SOURCE_DIR}/include/dynamic<br>
              ${PROJECT_SOURCE_DIR}/include/image<br>
              ${PROJECT_SOURCE_DIR}/include/management<br>
              ${PROJECT_SOURCE_DIR}/include/optimizer<br>
              ${PROJECT_SOURCE_DIR}/include/projector<br>
              ${PROJECT_SOURCE_DIR}/include/scanner<br>
              ${PROJECT_SOURCE_DIR}/include/utils<br>
            )<br>
            <br>
            #---------<br>
            # Defining configuration files<br>
            configure_file(<br>
              "${CASTOR_CONFIG_DIR}/oCASToRConfig.hh.in"<br>
              "${PROJECT_BINARY_DIR}/oCASToRConfig.hh"<br>
              @ONLY<br>
            )<br>
            <br>
            #---------<br>
            # Setting the CASTOR_CONFIG variable<br>
            set( CASTOR_CONFIG ${PROJECT_SOURCE_DIR}/config CACHE PATH<br>
              "Path to the CASTOR config repository"<br>
            )<br>
            <br>
            #---------<br>
            # Setting position of the CASToR utilitaries<br>
            set( TOOLKITS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/toolkits )<br>
            <br>
            # To avoid conflict between the makefile from CMake and the
            makefile provided<br>
            # by CASToR<br>
            add_definitions( -DCASToR_USE_CMAKE )<br>
            <br>
########################################################################<br>
            # Provide add_compile_options() when not available<br>
########################################################################<br>
            if( CMAKE_VERSION VERSION_LESS "2.8.12" )<br>
                function( add_compile_options )<br>
                    add_definitions( ${ARGN} )<br>
                endfunction( add_compile_options )<br>
            endif()<br>
            <br>
            <br>
            #---------<br>
            # Different option for Windows or Unix (Linux/MacOS)<br>
            if( WIN32 )<br>
            <br>
              #---------<br>
              # Delete some flags by default provided by CMAKE<br>
              #---------<br>
              string( REPLACE "/W3" "" CMAKE_CXX_FLAGS
            ${CMAKE_CXX_FLAGS} )<br>
              string( REPLACE "/O2" "" CMAKE_CXX_FLAGS_RELEASE
            ${CMAKE_CXX_FLAGS_RELEASE} )<br>
              string( REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE<br>
                ${CMAKE_CXX_FLAGS_RELEASE}<br>
              )<br>
              string( REPLACE "/MD" "" CMAKE_CXX_FLAGS_RELEASE
            ${CMAKE_CXX_FLAGS_RELEASE} )<br>
              string( REPLACE "/O2" "" CMAKE_CXX_FLAGS_RELEASE
            ${CMAKE_CXX_FLAGS_RELEASE} )<br>
            <br>
              # Visual studio flags by default /Ox<br>
              add_compile_options( /MP )<br>
            <br>
              #---------<br>
              # Checking for OpenMP<br>
              if( CASToR_OMP )<br>
                find_package( OpenMP REQUIRED )<br>
                set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}"
            )<br>
                set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
            ${OpenMP_CXX_FLAGS}" )<br>
                set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}<br>
                  ${OpenMP_EXE_LINKER_FLAGS}"<br>
                )<br>
                add_definitions( /DCASTOR_OMP )<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking for MPI<br>
              if( CASToR_MPI )<br>
                set( MPIEXEC "C:/Program Files/Microsoft
            MPI/Bin/mpiexec.exe" )<br>
                set( MPI_CXX_INCLUDE_PATH<br>
                  "C:/Program Files (x86)/Microsoft SDKs/MPI/Include"<br>
                )<br>
                if( "${CMAKE_SIZEOF_VOID_P}" EQUAL 8 )<br>
                  set( MS_MPI_ARCH_DIR x64 )<br>
                else()<br>
                  set( MS_MPI_ARCH_DIR x86 )<br>
                endif()<br>
                set( MPI_CXX_LIBRARIES<br>
                  "C:/Program Files (x86)/Microsoft
            SDKs/MPI/Lib/${MS_MPI_ARCH_DIR}/msmpi.lib"<br>
                )<br>
                set( MPI_C_INCLUDE_PATH "${MPI_CXX_INCLUDE_PATH}" )<br>
                set( MPI_C_LIBRARIES "${MPI_CXX_LIBRARIES}" )<br>
                set( MPIEXEC_NUMPROC_FLAG "-np" CACHE STRINGS<br>
                  "Flag used by MPI to specify the number of processes
            for MPIEXEC; the next option will be the number of
            processes."<br>
                )<br>
            <br>
                include_directories( ${MPI_CXX_INCLUDE_PATH} )<br>
                add_definitions( /DCASTOR_MPI )<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking verbosity<br>
              if( CASToR_VERBOSE )<br>
                add_compile_options( /W4 )<br>
                add_definitions( /DCASTOR_VERBOSE )<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking debug<br>
              if( CASToR_DEBUG )<br>
                add_compile_options( /W4 )<br>
                add_definitions( /DCASTOR_DEBUG )<br>
              endif()<br>
              <br>
              #---------<br>
              # Checking the mode Release/Debug<br>
              if( CMAKE_BUILD_TYPE MATCHES Release ) # Release mode<br>
                # Add release flags<br>
                add_compile_options( /Ox /O2 )<br>
            <br>
              else() # Debug mode<br>
                 # Add debug flags<br>
                  add_compile_options( /Od )<br>
                  add_definitions( /DCASTOR_DEBUG )<br>
              endif()<br>
              <br>
             <br>
            <br>
                #---------<br>
              # Checking for ROOT<br>
              if( CASToR_ROOT )<br>
                find_package( ROOT REQUIRED )<br>
                include_directories( ${ROOT_INCLUDE_DIR} )<br>
                set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                add_definitions( -DCASTOR_ROOT )<br>
              endif()<br>
            <br>
            <br>
              #---------<br>
              # GATE utilities<br>
              if( CASToR_BUILD_GATE_UTILITIES )<br>
                if(CASToR_ROOT)<br>
                else()<br>
                  message( "CASToR_ROOT switched to ON (ROOT required
            for GATE utilities) ${CMAKE_MODULE_PATH}" )<br>
                  set( ROOT_INCLUDE_DIR $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( ROOT_LIBRARY_DIR $ENV{ROOT_LIBRARY_DIR} )<br>
                  include_directories( $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                  add_definitions( /DCASTOR_ROOT )<br>
                  set( CASToR_ROOT ON CACHE BOOL "Force ROOT linking"
            FORCE)<br>
                endif()<br>
              endif()<br>
              <br>
            <br>
              #---------<br>
              # Checking for ROOT<br>
              if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
                if(CASToR_ROOT)<br>
                else()<br>
                  message( "CASToR_ROOT switched to ON (ROOT required
            for sample code utilities)" )<br>
                  set( ROOT_INCLUDE_DIR $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( ROOT_LIBRARY_DIR $ENV{ROOT_LIBRARY_DIR} )<br>
                  include_directories( $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                  add_definitions( /DCASTOR_ROOT )<br>
                  set( CASToR_ROOT ON CACHE BOOL "Force ROOT linking"
            FORCE)<br>
                endif()<br>
              endif()<br>
              <br>
              # Checking for both ROOT & 64bits enabled<br>
              # Force to 32 bits in this case, as ROOT can only be 32
            bits on WIN<br>
              # <a
              href="https://root-forum.cern.ch/t/native-windows-64-bit-build/9102/27"
              moz-do-not-send="true">https://root-forum.cern.ch/t/native-windows-64-bit-build/9102/27</a><br>
              # Display warning message<br>
              <br>
              #---------<br>
              # Checking the architecture 64/32 bits<br>
              if( CASToR_64bits )<br>
                if( CASToR_ROOT )<br>
                  message( "Architecture set to 32 bits as ROOT can only
            be built as 32 bits !" )<br>
                  message( "The generator may have to be manually
            changed to a 32 bits version !" )<br>
                  set( CASToR_64bits OFF CACHE BOOL "" FORCE)<br>
                else()<br>
                  add_definitions( /D_64 )<br>
                endif()<br>
              endif()<br>
              <br>
            <br>
              <br>
            # Unix fork (Linux/MacOS)<br>
            else()<br>
            <br>
              #---------<br>
              # Compiler-specific C++11 activation.<br>
              if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" )<br>
                execute_process(<br>
                  COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
            OUTPUT_VARIABLE GCC_VERSION<br>
                )<br>
                if( NOT( GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION
            VERSION_EQUAL 4.7 ) )<br>
                  message( FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7
            or greater." )<br>
                endif()<br>
                add_compile_options( -std=c++11 )<br>
              elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )<br>
                add_compile_options( -std=c++11 -stdlib=libc++ )<br>
              endif ()<br>
            <br>
              #---------<br>
              # Checking the architecture 64/32 bits<br>
              if( CASToR_64bits )<br>
                add_compile_options( -m64 )<br>
                add_definitions( -D_64 )<br>
              else()<br>
                add_compile_options( -m32 )<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking verbosity<br>
              if( CASToR_VERBOSE )<br>
                add_compile_options( -Wall -pedantic -Wextra )<br>
                add_definitions( -DCASTOR_VERBOSE )<br>
                if( CASToR_SIMD )<br>
                  add_compile_options( -ftree-vectorizer-verbose=2 )<br>
                endif()<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking debug<br>
              if( CASToR_DEBUG )<br>
                add_compile_options( -Wall -pedantic -Wextra )<br>
                add_definitions( -DCASTOR_DEBUG )<br>
                if( CASToR_SIMD )<br>
                  add_compile_options( -ftree-vectorizer-verbose=2 )<br>
                endif()<br>
              endif()<br>
              <br>
              #---------<br>
              # Checking for OpenMP<br>
              if( CASToR_OMP )<br>
                find_package( OpenMP REQUIRED )<br>
                add_compile_options( ${OpenMP_CXX_FLAGS} )<br>
                add_definitions( -DCASTOR_OMP )<br>
              endif()<br>
            <br>
              #---------<br>
              # Checking for MPI<br>
              if( CASToR_MPI )<br>
                find_package( MPI REQUIRED )<br>
                include_directories( ${MPI_INCLUDE_PATH} )<br>
                add_definitions( -DCASTOR_MPI )<br>
              endif()<br>
            <br>
              if( CASToR_BUILD_GATE_UTILITIES )<br>
                if(CASToR_ROOT)<br>
                else()<br>
                  message( "CASToR_ROOT switched to ON (ROOT required
            for GATE utilities)" )<br>
                  set( ROOT_INCLUDE_DIR $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( ROOT_LIBRARY_DIR $ENV{ROOT_LIBRARY_DIR} )<br>
                  include_directories( $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                  add_definitions( /DCASTOR_ROOT )<br>
                  set( CASToR_ROOT ON CACHE BOOL "Force ROOT linking"
            FORCE)<br>
                endif()<br>
              endif()<br>
              <br>
            <br>
              #---------<br>
              # Checking for ROOT<br>
              if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
                if(CASToR_ROOT)<br>
                else()<br>
                  message( "CASToR_ROOT switched to ON (ROOT required
            for sample code utilities)" )<br>
                  set( ROOT_INCLUDE_DIR $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( ROOT_LIBRARY_DIR $ENV{ROOT_LIBRARY_DIR} )<br>
                  include_directories( $ENV{ROOT_INCLUDE_DIR} )<br>
                  set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                  add_definitions( /DCASTOR_ROOT )<br>
                  set( CASToR_ROOT ON CACHE BOOL "Force ROOT linking"
            FORCE)<br>
                endif()<br>
              endif()<br>
              <br>
              #---------<br>
              # Checking for ROOT<br>
              if( CASToR_ROOT )<br>
                find_package( ROOT REQUIRED )<br>
                include_directories( ${ROOT_INCLUDE_DIR} )<br>
                set( LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} )<br>
                    message( "${ROOT_INCLUDE_DIR} " ${ROOT_INCLUDE_DIR})<br>
                message( "${ROOT_LIBRARY_DIR} " ${ROOT_LIBRARY_DIR})<br>
                add_definitions( -DCASTOR_ROOT )<br>
              endif()<br>
            <br>
              #--------- // LEDESMA deformation library. Not planned to
            be included in Castor, just for private testing.<br>
              # Checking for LEDESMA <br>
              #if( CASToR_DEFORMATION_LEDESMA )<br>
              #  include_directories(
            ${PROJECT_SOURCE_DIR}/include/image/lib )<br>
              #  set( LINK_DIRECTORIES
            ${PROJECT_SOURCE_DIR}/include/image/lib
            -lElasticRegistration)<br>
              #  set( DEFORMATION_LEDESMA_LIBRARIES
            -L${PROJECT_SOURCE_DIR}/include/image/lib\
            -lElasticRegistration)<br>
              #  add_definitions( -DCASTOR_DEFORMATION_LEDESMA )<br>
              #endif()<br>
              <br>
              #---------<br>
              # Checking for ELASTIX<br>
              #if( CASToR_ELASTIX )<br>
              #  set( ELASTIX_BUILD_DIR "" CACHE PATH "Path to elastix
            build folder" )<br>
              #  set( ELASTIX_USE_FILE
            ${ELASTIX_BUILD_DIR}/UseElastix.cmake )<br>
            <br>
              #  option( USE_ITK_FOR_ELASTIX "Use ITK (required for
            elastix)" ON )<br>
              #  find_package( ITK )<br>
              #  if( ITK_FOUND )<br>
              #    include( ${ITK_USE_FILE} )<br>
              #  else( ITK_FOUND )<br>
              #    message( FATAL_ERROR "Cannot build CASToR using
            ELASTIX without ITK. Please set ITK_DIR." )<br>
              #  endif( ITK_FOUND )<br>
            <br>
              #  if( EXISTS ${ELASTIX_USE_FILE} )<br>
              #    include( ${ELASTIX_USE_FILE} )<br>
              #    link_libraries( param )<br>
              #    link_libraries( elastix )<br>
              #    link_libraries( transformix )<br>
              #    add_definitions( -DCASTOR_ELASTIX )<br>
              #  endif()<br>
            <br>
              #endif()<br>
            <br>
              #---------<br>
              # Checking the mode Release/Debug<br>
              if( CMAKE_BUILD_TYPE MATCHES Release ) # Release mode<br>
                # Add release flags<br>
                add_compile_options( -O3 )<br>
            <br>
                # Add SIMD flags<br>
                if( CASToR_SIMD )<br>
                  add_compile_options(<br>
                    -ftree-vectorize -msse2 -fassociative-math<br>
                  )<br>
                endif()<br>
              else() # Debug mode<br>
                 # Add debug flags<br>
                  add_compile_options( -O0 -g3 -fno-inline -pg )<br>
                  add_definitions( -DCASTOR_DEBUG )<br>
              endif()<br>
            <br>
            endif()<br>
            <br>
            #---------<br>
            # Setup include directory for this project<br>
            include_directories(<br>
              ${CMAKE_CURRENT_BINARY_DIR}<br>
              ${PROJECT_SOURCE_DIR}/include/algorithm<br>
              ${PROJECT_SOURCE_DIR}/include/analytic_simulator<br>
              ${PROJECT_SOURCE_DIR}/include/datafile<br>
              ${PROJECT_SOURCE_DIR}/include/dynamic<br>
              ${PROJECT_SOURCE_DIR}/include/image<br>
              ${PROJECT_SOURCE_DIR}/include/management<br>
              ${PROJECT_SOURCE_DIR}/include/optimizer<br>
              ${PROJECT_SOURCE_DIR}/include/projector<br>
              ${PROJECT_SOURCE_DIR}/include/scanner<br>
              ${PROJECT_SOURCE_DIR}/include/utils<br>
            )<br>
            <br>
            #---------<br>
            # Locate sources and headers for CASToR<br>
            file( GLOB_RECURSE sources ${PROJECT_SOURCE_DIR}/src/*.cc )<br>
            file( GLOB_RECURSE headers
            ${PROJECT_SOURCE_DIR}/include/*.hh )<br>
            <br>
            #---------<br>
            # Build the executables<br>
            add_executable( castor-recon castor-recon.cc ${sources}
            ${headers} )<br>
            add_executable( castor-datafileExplorer
            ${TOOLKITS_SOURCE_DIR}/castor-datafileExplorer.cc ${sources}
            ${headers} )<br>
            add_executable( castor-scannerLUTExplorer
            ${TOOLKITS_SOURCE_DIR}/castor-scannerLUTExplorer.cc
            ${sources} ${headers} )<br>
            add_executable( castor-imageDynamicTools
            ${TOOLKITS_SOURCE_DIR}/castor-imageDynamicTools.cc
            ${sources} ${headers} )<br>
            if( CASToR_BUILD_DEVEL)<br>
              add_executable( castor-proj castor-proj.cc ${sources}
            ${headers} )<br>
            endif()<br>
            <br>
            # Build GATE tools for CASToR <br>
            if( CASToR_BUILD_GATE_UTILITIES )<br>
              add_executable( castor-GATERootToCastor
            ${TOOLKITS_SOURCE_DIR}/castor-GATERootToCastor.cc ${sources}
            ${headers} )<br>
              add_executable( castor-GATEMacToGeom   
            ${TOOLKITS_SOURCE_DIR}/castor-GATEMacToGeom.cc ${sources}<br>
              ${headers} )<br>
            endif()<br>
            <br>
            # Build GATE tools for CASToR <br>
            if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
              add_executable( castor-PetScannerLutEx     
            ${TOOLKITS_SOURCE_DIR}/castor-PetScannerLutEx.cc ${sources}
            ${headers} )<br>
              add_executable( castor-datafileConversionEx
            ${TOOLKITS_SOURCE_DIR}/castor-datafileConversionEx.cc
            ${sources}<br>
              ${headers} )<br>
            endif()<br>
              <br>
            if( WIN32 )<br>
              target_link_libraries( castor-recon ${ROOT_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
              )<br>
              target_link_libraries( castor-datafileExplorer
            ${ROOT_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
              )<br>
              target_link_libraries( castor-scannerLUTExplorer
            ${ROOT_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
              )<br>
              target_link_libraries( castor-imageDynamicTools
            ${ROOT_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
              )<br>
              if( CASToR_BUILD_DEVEL )<br>
                target_link_libraries( castor-proj ${ROOT_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
                )<br>
              endif()<br>
              if( CASToR_BUILD_GATE_UTILITIES )<br>
                target_link_libraries( castor-GATERootToCastor
            ${ROOT_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
                )<br>
                target_link_libraries( castor-GATEMacToGeom
            ${ROOT_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
                )<br>
              endif()<br>
              if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
                target_link_libraries( castor-PetScannerLutEx
            ${ROOT_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
                )<br>
                target_link_libraries( castor-datafileConversionEx
            ${ROOT_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${MPI_CXX_LIBRARIES}<br>
                )<br>
              endif()<br>
              <br>
            else()<br>
              target_link_libraries( castor-recon ${ROOT_LIBRARIES}
            ${OpenMP_CXX_FLAGS} ${MPI_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES} )<br>
              target_link_libraries( castor-datafileExplorer
            ${ROOT_LIBRARIES} ${OpenMP_CXX_FLAGS} ${MPI_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES} )<br>
              target_link_libraries( castor-scannerLUTExplorer
            ${ROOT_LIBRARIES} ${OpenMP_CXX_FLAGS} ${MPI_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES} )<br>
              target_link_libraries( castor-imageDynamicTools
            ${ROOT_LIBRARIES} ${OpenMP_CXX_FLAGS} ${MPI_LIBRARIES}<br>
                ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}<br>
              )<br>
              if( CASToR_BUILD_DEVEL )<br>
                target_link_libraries( castor-proj ${ROOT_LIBRARIES}
            ${MPI_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${OpenMP_CXX_FLAGS}<br>
                )<br>
              endif()<br>
              if( CASToR_BUILD_GATE_UTILITIES )<br>
                target_link_libraries( castor-GATERootToCastor
            ${ROOT_LIBRARIES} ${MPI_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${OpenMP_CXX_FLAGS}<br>
                )<br>
                target_link_libraries( castor-GATEMacToGeom
            ${ROOT_LIBRARIES} ${MPI_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${OpenMP_CXX_FLAGS}<br>
                )<br>
              endif()<br>
              if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
                target_link_libraries( castor-PetScannerLutEx
            ${ROOT_LIBRARIES} ${MPI_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${OpenMP_CXX_FLAGS}<br>
                )<br>
                target_link_libraries( castor-datafileConversionEx
            ${ROOT_LIBRARIES} ${MPI_LIBRARIES}<br>
                  ${DEFORMATION_LEDESMA_LIBRARIES} ${ITK_LIBRARIES}
            ${OpenMP_CXX_FLAGS}<br>
                )<br>
              endif()<br>
            endif()<br>
            <br>
            #---------<br>
            # Move the executables to the install path<br>
            install( TARGETS<br>
              castor-recon castor-datafileExplorer
            castor-scannerLUTExplorer castor-imageDynamicTools<br>
              DESTINATION<br>
              bin<br>
            )<br>
            <br>
            if( CASToR_BUILD_DEVEL )<br>
              install( TARGETS<br>
                castor-proj<br>
                DESTINATION<br>
                bin<br>
              )<br>
            endif()<br>
            <br>
            if( CASToR_BUILD_GATE_UTILITIES )<br>
              install( TARGETS<br>
                castor-GATERootToCastor castor-GATEMacToGeom<br>
                DESTINATION<br>
                bin<br>
              )<br>
            endif()<br>
            <br>
            if( CASToR_BUILD_SAMPLE_UTILITIES )<br>
              install( TARGETS<br>
                castor-PetScannerLutEx castor-datafileConversionEx<br>
                DESTINATION<br>
                bin<br>
              )<br>
            endif()<br>
            <br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            Subject: Digest Footer<br>
            <br>
            _______________________________________________<br>
            Castor-users mailing list<br>
            <a class="moz-txt-link-abbreviated" href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a><br>
            <a
              href="http://lists.castor-project.org/listinfo/castor-users"
              moz-do-not-send="true">http://lists.castor-project.org/listinfo/castor-users</a><br>
            <br>
            <br>
            ------------------------------<br>
            <br>
            End of Castor-users Digest, Vol 36, Issue 13<br>
            ********************************************<br>
          </div>
        </span></font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Castor-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Castor-users@lists.castor-project.org">Castor-users@lists.castor-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.castor-project.org/listinfo/castor-users">http://lists.castor-project.org/listinfo/castor-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Thibaut MERLIN -- PhD

Docteur en Imagerie Médicale au Laboratoire de Traitement de l'Information Medicale (LaTIM - INSERM UMR 1101)
Institut Brestois de recherche en Bio-Santé (IBRBS)
12 Avenue Foch, 29200 Brest, FRANCE
Tel: 06.75.12.24.90</pre>
  </body>
</html>