<commit_before>/*=========================================================================
 *
 *  Copyright RTK Consortium
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *=========================================================================*/

#ifndef __rtkProjectionsReader_h
#define __rtkProjectionsReader_h

// ITK
#include <itkImageSource.h>
#include <itkImageIOFactory.h>
#include <itkStreamingImageFilter.h>

// RTK
#include "rtkWaterPrecorrectionImageFilter.h"

// Standard lib
#include <vector>
#include <string>

namespace rtk
{

/** \class ProjectionsReader
 *
 * This is the universal projections reader of rtk (raw data converted to
 * attenuation). Currently handles his (Elekta Synergy), hnd (Varian OBI),
 * tiff (Digisens), edf (ESRF), XRad. For all other ITK file formats, it is
 * assumed that the attenuation is directly passed and there is no processing.
 * Optionnally, one can activate cropping, binning, scatter correction, etc.
 * The details of the mini-pipeline is provided below, note that dashed filters
 * are shunt if they are not required according to parameters.
 *
 * \dot
 * digraph ProjectionsReader {
 *
 * Output [label="Output (Projections)", shape=Mdiamond];
 *
 * node [shape=box];
 * Raw [label="itk::ImageSeriesReader" URL="\ref itk::ImageSeriesReader"];
 * ElektaRaw [label="rtk::ElektaSynergyRawLookupTableImageFilter" URL="\ref rtk::ElektaSynergyRawLookupTableImageFilter"];
 * ChangeInformation [label="itk::ChangeInformationImageFilter" URL="\ref itk::ChangeInformationImageFilter" style=dashed];
 * Crop [label="itk::CropImageFilter" URL="\ref itk::CropImageFilter" style=dashed];
 * Binning [label="itk::BinShrinkImageFilter" URL="\ref itk::BinShrinkImageFilter" style=dashed];
 * Scatter [label="rtk::BoellaardScatterCorrectionImageFilter" URL="\ref rtk::BoellaardScatterCorrectionImageFilter" style=dashed];
 * I0est [label="rtk::I0EstimationProjectionFilter" URL="\ref rtk::I0EstimationProjectionFilter" style=dashed];
 * LUT [label="rtk::LUTbasedVariableI0RawToAttenuationImageFilter" URL="\ref rtk::LUTbasedVariableI0RawToAttenuationImageFilter"];
 * Varian [label="rtk::VarianObiRawImageFilter" URL="\ref rtk::VarianObiRawImageFilter"];
 * WPC [label="rtk::WaterPrecorrectionImageFilter" URL="\ref rtk::WaterPrecorrectionImageFilter" style=dashed];
 * Streaming [label="itk::StreamingImageFilter" URL="\ref itk::StreamingImageFilter"];
 * EDF [label="rtk::EdfRawToAttenuationImageFilter"  URL="\ref rtk::EdfRawToAttenuationImageFilter"];
 * XRad [label="rtk::XRadRawToAttenuationImageFilter"  URL="\ref rtk::XRadRawToAttenuationImageFilter"];
 *
 * Raw->ChangeInformation [label="Default"]
 * ChangeInformation->Crop
 * Crop->ElektaRaw [label="Elekta"]
 * ElektaRaw->Binning
 * Crop->Binning [label="Default"]
 * Binning->Scatter [label="Elekta, Varian, IBA"]
 * Scatter->I0est [label="Default"]
 * I0est->LUT
 * LUT->WPC
 * Scatter->Varian [label="Varian"]
 * Varian->WPC
 * EDF->WPC
 * Raw->EDF [label="edf"]
 * XRad->WPC
 * Raw->XRad [label="XRad"]
 * WPC->Streaming
 * Streaming->Output
 *
 * Binning->WPC [label="Default"]
 *
 * {rank=same; XRad EDF Varian LUT}
 * }
 * \enddot
 *
 * \test rtkedftest.cxx, rtkelektatest.cxx, rtkimagxtest.cxx,
 * rtkdigisenstest.cxx, rtkxradtest.cxx, rtkvariantest.cxx
 *
 * \author <NAME>
 *
 * \ingroup ImageSource
 */
template <class TOutputImage>
class ITK_EXPORT ProjectionsReader : public itk::ImageSource<TOutputImage>
{<commit_msg>Forgot to document that projections with unsigned short pixels are now processed as if log had not been taken (previous commit)<commit_after>/*=========================================================================
 *
 *  Copyright RTK Consortium
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *=========================================================================*/

#ifndef __rtkProjectionsReader_h
#define __rtkProjectionsReader_h

// ITK
#include <itkImageSource.h>
#include <itkImageIOFactory.h>
#include <itkStreamingImageFilter.h>

// RTK
#include "rtkWaterPrecorrectionImageFilter.h"

// Standard lib
#include <vector>
#include <string>

namespace rtk
{

/** \class ProjectionsReader
 *
 * This is the universal projections reader of rtk (raw data converted to
 * attenuation). Currently handles his (Elekta Synergy), hnd (Varian OBI),
 * tiff (Digisens), edf (ESRF), XRad. For all other ITK file formats, it is
 * assumed that the attenuation is directly passed and there is no processing.
 * Optionnally, one can activate cropping, binning, scatter correction, etc.
 * The details of the mini-pipeline is provided below, note that dashed filters
 * are shunt if they are not required according to parameters.
 *
 * \dot
 * digraph ProjectionsReader {
 *
 * Output [label="Output (Projections)", shape=Mdiamond];
 *
 * node [shape=box];
 * Raw [label="itk::ImageSeriesReader" URL="\ref itk::ImageSeriesReader"];
 * ElektaRaw [label="rtk::ElektaSynergyRawLookupTableImageFilter" URL="\ref rtk::ElektaSynergyRawLookupTableImageFilter"];
 * ChangeInformation [label="itk::ChangeInformationImageFilter" URL="\ref itk::ChangeInformationImageFilter" style=dashed];
 * Crop [label="itk::CropImageFilter" URL="\ref itk::CropImageFilter" style=dashed];
 * Binning [label="itk::BinShrinkImageFilter" URL="\ref itk::BinShrinkImageFilter" style=dashed];
 * Scatter [label="rtk::BoellaardScatterCorrectionImageFilter" URL="\ref rtk::BoellaardScatterCorrectionImageFilter" style=dashed];
 * I0est [label="rtk::I0EstimationProjectionFilter" URL="\ref rtk::I0EstimationProjectionFilter" style=dashed];
 * LUT [label="rtk::LUTbasedVariableI0RawToAttenuationImageFilter" URL="\ref rtk::LUTbasedVariableI0RawToAttenuationImageFilter"];
 * Varian [label="rtk::VarianObiRawImageFilter" URL="\ref rtk::VarianObiRawImageFilter"];
 * WPC [label="rtk::WaterPrecorrectionImageFilter" URL="\ref rtk::WaterPrecorrectionImageFilter" style=dashed];
 * Streaming [label="itk::StreamingImageFilter" URL="\ref itk::StreamingImageFilter"];
 * EDF [label="rtk::EdfRawToAttenuationImageFilter"  URL="\ref rtk::EdfRawToAttenuationImageFilter"];
 * XRad [label="rtk::XRadRawToAttenuationImageFilter"  URL="\ref rtk::XRadRawToAttenuationImageFilter"];
 *
 * Raw->ChangeInformation [label="Default"]
 * ChangeInformation->Crop
 * Crop->ElektaRaw [label="Elekta"]
 * ElektaRaw->Binning
 * Crop->Binning [label="Default"]
 * Binning->Scatter [label="Elekta, Varian, IBA, ushort"]
 * Scatter->I0est [label="Default"]
 * I0est->LUT
 * LUT->WPC
 * Scatter->Varian [label="Varian"]
 * Varian->WPC
 * EDF->WPC
 * Raw->EDF [label="edf"]
 * XRad->WPC
 * Raw->XRad [label="XRad"]
 * WPC->Streaming
 * Streaming->Output
 *
 * Binning->WPC [label="Default"]
 *
 * {rank=same; XRad EDF Varian LUT}
 * }
 * \enddot
 *
 * \test rtkedftest.cxx, rtkelektatest.cxx, rtkimagxtest.cxx,
 * rtkdigisenstest.cxx, rtkxradtest.cxx, rtkvariantest.cxx
 *
 * \author <NAME>
 *
 * \ingroup ImageSource
 */
template <class TOutputImage>
class ITK_EXPORT ProjectionsReader : public itk::ImageSource<TOutputImage>
{
{'fraction_non_alphanumeric': 0.15752234359483613, 'fraction_numerical': 0.002730883813306852, 'mean_word_length': 5.993923611111111, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6408564', 'n_tokens_mistral': 2598, 'n_tokens_neox': 2498, 'n_words': 629}