Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:e6d42e6731ce66e3c09de07ac49964c03139e990
  • Code
  • Branches (11)
  • Releases (5)
    • Branches
    • Releases
    • HEAD
    • refs/heads/T2
    • refs/heads/develop
    • refs/heads/developCI
    • refs/heads/developCI2
    • refs/heads/developCI3
    • refs/heads/gh-pages
    • refs/heads/master
    • refs/heads/newBuild
    • refs/tags/v0.1
    • refs/tags/v0.11
    • refs/tags/v0.4
    • v0.4.3
    • v0.4.2
    • v0.4.1
    • v0.3
    • v0.2
  • a8da687
  • /
  • app
  • /
  • Tomato.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
  • release
content badge
swh:1:cnt:bc6e4ec529dc5200364be7e555ac1c5b639fe204
directory badge
swh:1:dir:1ed40e3ea1093bf35f08f8feafea7e3cb2f2c8ac
revision badge
swh:1:rev:1b619a75151e3d5d95d32a2fb732e1208ec0cd33
snapshot badge
swh:1:snp:e6d42e6731ce66e3c09de07ac49964c03139e990
release badge
swh:1:rel:d287a37166dac096e3f9579efd1f4b56c5bf5480

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
  • release
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 1b619a75151e3d5d95d32a2fb732e1208ec0cd33 authored by Konrad Werys on 01 November 2019, 11:50:53 UTC
ci: big changes to the builds v11
Tip revision: 1b619a7
Tomato.h
/*!
 * \file Tomato.h
 * \author Konrad Werys
 * \date 2018/08/14
 */

#ifndef Tomato_Tomato_H
#define Tomato_Tomato_H

#include "CmakeConfigForTomato.h"
#ifdef USE_ITK

#include "TomatoOptions.h"
#include "TomatoColormap.h"

#include "itkReadFileListFilter.h"
#include "itkReadDirectoryFilter.h"
#include "itkSortInvTimesImageFilter.h"
#include "itkCalculatorT1ImageFilter.h"
#include "itkColorbar2DImageFilter.h"
#include "itkNShmolliSamplesUsedTo123ImageFilter.h"

#include "itkTimeProbe.h"
// for exporting
#include "gdcmUIDGenerator.h"
#include "itkGDCMImageIO.h"
#include "itkGDCMSeriesFileNames.h"
#include "itkMultiplyImageFilter.h"
#include "itkImageFileWriter.h"
#include "itkFileTools.h"
#include "itkAdaptImageFilter.h"

namespace Ox {

    /**
     * \class Tomato
     * includes factories and methods needed for calculation
     */
    template< typename MeasureType >
    class Tomato {

    public:
        // typedefs primitive data types
        typedef MeasureType InputPixelType;
        typedef int16_t OutputPixelType; // int does not work with some dicom viewers, be sure to use short (int16)

        // typedefs image data types
        typedef itk::Image<InputPixelType, 3> ImageType3D;
        typedef itk::Image<InputPixelType, 2> ImageType2D;
        typedef itk::Image<OutputPixelType, 2> OutputImageType;
        typedef itk::ReadFileListFilter<ImageType3D> ReadFileListFilterType;
        typedef itk::ReadDirectoryFilter<ImageType3D> ReadDirectoryFilterType;
        typedef itk::SortInvTimesImageFilter<ImageType3D, ImageType3D> SortInvTimesImageFilterType;
        typedef itk::CalculatorT1ImageFilter<ImageType3D, ImageType2D> CalculatorT1ImageFilterType;
        typedef itk::MetaDataDictionary DictionaryType;

        // member variables
        TomatoOptions<InputPixelType> *_opts;
        InputPixelType *_invTimes;
        InputPixelType *_echoTimes;
        int _nSamples;
        typename ImageType3D::Pointer _imageMag;
        typename ImageType3D::Pointer _imagePha;

        typename CalculatorT1ImageFilterType::Pointer _imageCalculatorItk;
        //SortInvTimesImageFilterType::Pointer _sorterMag;
        //SortInvTimesImageFilterType::Pointer _sorterPha;

        DictionaryType _dictionaryInput;

        /**
         * readAndSort
         * @return success/failure
         */
        int readAndSort();

        /**
         * calculate
         * @return success/failure
         */
        int calculate();

        /**
         * method so long and ugly, that I put it in a separate file
         * @return success/failure
         */
        int exportToDicom();

        /**
         * constructor
         * @param inputFileName
         */
        Tomato(std::string inputFileName);

        /**
         * \brief do not forget about the virtual destructor, see
         * https://stackoverflow.com/questions/461203/when-to-use-virtual-destructors
         */
        virtual ~Tomato();

    private:
        /**
         * We do not want the default constructor, so let's make it private.
         * I cant delete it to be compatible with c++98
         */
        Tomato(){};

        /**
         * readAndSortInputFileList
         * @return success/failure
         */
        int readAndSortInputFileList();

        /**
         * readAndSortInputDirs
         * @return success/failure
         */
        int readAndSortInputDirs();

    };

} // namespace Ox

#include "Tomato.hxx"
#include "Tomato_export.hxx"

#endif

#endif //Tomato_Tomato_H

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API