<commit_before>#include "mitkImageSource.h"

mitk::ImageSource::ImageSource()
{
  // Create the output. We use static_cast<> here because we know the default
  // output must be of type TOutputImage
  OutputImageType::Pointer output
    = static_cast<OutputImageType*>(this->MakeOutput(0).GetPointer()); 
  Superclass::SetNumberOfRequiredOutputs(1);
  Superclass::SetNthOutput(0, output.GetPointer());
}

/**
 *
 */
//##ModelId=3E1886F103DB
mitk::ImageSource::DataObjectPointer mitk::ImageSource::MakeOutput(unsigned int)
{
	return static_cast<itk::DataObject*>(OutputImageType::New().GetPointer());
}
  
/**
 *
 */
mitk::ImageSource::OutputImageType* mitk::ImageSource::GetOutput()
{
  if (this->GetNumberOfOutputs() < 1)
    {
    return 0;
    }
  
  return static_cast<OutputImageType*>
                     (this->BaseProcess::GetOutput(0));
}

  
/**
 *
 */
//##ModelId=3E1886F101F0
mitk::ImageSource::OutputImageType* mitk::ImageSource::GetOutput(unsigned int idx)
{
  return static_cast<OutputImageType*>
                     (this->ProcessObject::GetOutput(idx));
}


/**
 *
 */
//##ModelId=3E1886F1024A
void mitk::ImageSource::SetOutput(OutputImageType *output)
{
  itkWarningMacro(<< "SetOutput(): This method is slated to be removed from ITK.  Please use GraftOutput() in possible combination with DisconnectPipeline() instead." );
  BaseProcess::SetNthOutput(0, output);
}


/**
 * 
 */
//##ModelId=3E1886F102A5
void mitk::ImageSource::GraftOutput(OutputImageType *graft)
{
  this->GraftNthOutput(0, graft);
}


/**
 * 
 */

//##ModelId=3E1886F10313
void mitk::ImageSource::GraftNthOutput(unsigned int idx, OutputImageType* graft)
{
  if (idx < this->GetNumberOfOutputs())
    {
    OutputImageType * output = this->GetOutput(idx);

    if (output && graft)
      {
      // grab a handle to the bulk data of the specified data object<commit_msg>added warining and assert for GraftNthOutput(), because it is not implemented yet<commit_after>#include "mitkImageSource.h"

mitk::ImageSource::ImageSource()
{
  // Create the output. We use static_cast<> here because we know the default
  // output must be of type TOutputImage
  OutputImageType::Pointer output
    = static_cast<OutputImageType*>(this->MakeOutput(0).GetPointer()); 
  Superclass::SetNumberOfRequiredOutputs(1);
  Superclass::SetNthOutput(0, output.GetPointer());
}

/**
 *
 */
//##ModelId=3E1886F103DB
mitk::ImageSource::DataObjectPointer mitk::ImageSource::MakeOutput(unsigned int)
{
	return static_cast<itk::DataObject*>(OutputImageType::New().GetPointer());
}
  
/**
 *
 */
mitk::ImageSource::OutputImageType* mitk::ImageSource::GetOutput()
{
  if (this->GetNumberOfOutputs() < 1)
    {
    return 0;
    }
  
  return static_cast<OutputImageType*>
                     (this->BaseProcess::GetOutput(0));
}

  
/**
 *
 */
//##ModelId=3E1886F101F0
mitk::ImageSource::OutputImageType* mitk::ImageSource::GetOutput(unsigned int idx)
{
  return static_cast<OutputImageType*>
                     (this->ProcessObject::GetOutput(idx));
}


/**
 *
 */
//##ModelId=3E1886F1024A
void mitk::ImageSource::SetOutput(OutputImageType *output)
{
  itkWarningMacro(<< "SetOutput(): This method is slated to be removed from ITK.  Please use GraftOutput() in possible combination with DisconnectPipeline() instead." );
  BaseProcess::SetNthOutput(0, output);
}


/**
 * 
 */
//##ModelId=3E1886F102A5
void mitk::ImageSource::GraftOutput(OutputImageType *graft)
{
  this->GraftNthOutput(0, graft);
}


/**
 * 
 */

//##ModelId=3E1886F10313
void mitk::ImageSource::GraftNthOutput(unsigned int idx, OutputImageType* graft)
{
  itkWarningMacro(<< "GraftNthOutput(): This method is not yet implemented for mitk. Implement it before using!!" );
  assert(false);
  if (idx < this->GetNumberOfOutputs())
    {
    OutputImageType * output = this->GetOutput(idx);

    if (output && graft)
      {
      // grab a handle to the bulk data of the specified data object
{'fraction_non_alphanumeric': 0.1461734693877551, 'fraction_numerical': 0.027040816326530614, 'mean_word_length': 4.49929873772791, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2472849', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1275, 'n_words': 247}