<commit_before>/*=========================================================================

Program:   Insight Segmentation & Registration Toolkit
Module:    $RCSfile: itkImageSeriesReader.txx,v $
Language:  C++
Date:      $Date: 2007-08-17 20:16:25 $
Version:   $Revision: 1.31 $

Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

This software is distributed WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __mitkNrrdDiffusionVolumesReader_cpp
#define __mitkNrrdDiffusionVolumesReader_cpp

#include "mitkNrrdDiffusionVolumesReader.h"

#include "itkImageFileReader.h"
#include "itkMetaDataObject.h"
#include "itkNrrdImageIO.h"

namespace mitk
{

  template <class TPixelType>
  void NrrdDiffusionVolumesReader<TPixelType>
    ::GenerateData()
  {

    // Since everything is completely read in GenerateOutputInformation() it is stored
    // in a cache variable. A timestamp is associated.
    // If the timestamp of the cache variable is newer than the MTime, we only need to
    // assign the cache variable to the DataObject.
    // Otherwise, the tree must be read again from the file and OuputInformation must 
    // be updated!
    if ( ( ! m_OutputCache ) || ( this->GetMTime( ) > m_CacheTime.GetMTime( ) ) )
    {
      this->GenerateOutputInformation();
      itkWarningMacro("Cache regenerated!");    
    }

    if (!m_OutputCache)
    {
      itkWarningMacro("Tree cache is empty!");    
    }

    OutputType::Pointer output = this->GetOutput();
    output->SetImage(m_OutputCache->GetImage());
    output->SetB_Value(m_OutputCache->GetB_Value());
    output->SetDirections(m_OutputCache->GetDirections());

  }

  template <class TPixelType>
  void NrrdDiffusionVolumesReader<TPixelType>::GenerateOutputInformation()
  {
    OutputType::Pointer outputForCache = OutputType::New();
    if ( m_FileName == "") <commit_msg>COMP: typename<commit_after>/*=========================================================================

Program:   Insight Segmentation & Registration Toolkit
Module:    $RCSfile: itkImageSeriesReader.txx,v $
Language:  C++
Date:      $Date: 2007-08-17 20:16:25 $
Version:   $Revision: 1.31 $

Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

This software is distributed WITHOUT ANY WARRANTY; without even 
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __mitkNrrdDiffusionVolumesReader_cpp
#define __mitkNrrdDiffusionVolumesReader_cpp

#include "mitkNrrdDiffusionVolumesReader.h"

#include "itkImageFileReader.h"
#include "itkMetaDataObject.h"
#include "itkNrrdImageIO.h"

namespace mitk
{

  template <class TPixelType>
  void NrrdDiffusionVolumesReader<TPixelType>
    ::GenerateData()
  {

    // Since everything is completely read in GenerateOutputInformation() it is stored
    // in a cache variable. A timestamp is associated.
    // If the timestamp of the cache variable is newer than the MTime, we only need to
    // assign the cache variable to the DataObject.
    // Otherwise, the tree must be read again from the file and OuputInformation must 
    // be updated!
    if ( ( ! m_OutputCache ) || ( this->GetMTime( ) > m_CacheTime.GetMTime( ) ) )
    {
      this->GenerateOutputInformation();
      itkWarningMacro("Cache regenerated!");    
    }

    if (!m_OutputCache)
    {
      itkWarningMacro("Tree cache is empty!");    
    }

    typename OutputType::Pointer output = this->GetOutput();
    output->SetImage(m_OutputCache->GetImage());
    output->SetB_Value(m_OutputCache->GetB_Value());
    output->SetDirections(m_OutputCache->GetDirections());

  }

  template <class TPixelType>
  void NrrdDiffusionVolumesReader<TPixelType>::GenerateOutputInformation()
  {
    OutputType::Pointer outputForCache = OutputType::New();
    if ( m_FileName == "") 
{'fraction_non_alphanumeric': 0.16027140851661206, 'fraction_numerical': 0.007955077211043519, 'mean_word_length': 4.404551201011378, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 31, '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': '143501', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1192, 'n_words': 332}