<commit_before>#include <pic2vtk/pic2vtk.h>
#include <vtkStructuredPointsReader.h>
#include <vtkImageCast.h> 
#include <vtkImageData.h> 
#include <vtkDataObject.h> 
#include <iostream>

/**
 * konvertiert ein vtkImageReader in ein pic-Image 
 */ 
ipPicDescriptor* Pic2vtk::convert( vtkImageData* vtkImage ) {

	if ( vtkImage == NULL )
		return NULL;

	ipPicDescriptor* pic = ipPicNew();

	if ( pic == NULL )
		return NULL;

	int dim[3];
	vtkImage->GetDimensions(dim);

	if ( dim[2] > 1 ) {
		pic->dim = 3;		
	} else if( dim[1] > 1 ) {
		pic->dim = 2;
	} else if ( dim[0] > 1 ) {
		pic->dim = 1;
	} else {
	  cerr << "Can't determine dimensions of vtkImageData" << endl;
	  assert(false);
	}<commit_msg>CHG: bug #607 (and part of bug #626): return NULL instead of assert(false) in case of vtkImage with dims==0<commit_after>#include <pic2vtk/pic2vtk.h>
#include <vtkStructuredPointsReader.h>
#include <vtkImageCast.h> 
#include <vtkImageData.h> 
#include <vtkDataObject.h> 
#include <iostream>

/**
 * konvertiert ein vtkImageReader in ein pic-Image 
 */ 
ipPicDescriptor* Pic2vtk::convert( vtkImageData* vtkImage ) {

	if ( vtkImage == NULL )
		return NULL;

	ipPicDescriptor* pic = ipPicNew();

	if ( pic == NULL )
		return NULL;

	int dim[3];
	vtkImage->GetDimensions(dim);

	if ( dim[2] > 1 ) {
		pic->dim = 3;		
	} else if( dim[1] > 1 ) {
		pic->dim = 2;
	} else if ( dim[0] > 1 ) {
		pic->dim = 1;
	} else {
	  return NULL;
	}
{'fraction_non_alphanumeric': 0.15373864430468204, 'fraction_numerical': 0.023060796645702306, 'mean_word_length': 3.6493506493506493, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, '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': '7632716', 'n_tokens_mistral': 621, 'n_tokens_neox': 569, 'n_words': 140}