public static int Main(string[] args) { string directory = args[0]; string outfilename = args[1]; Directory d = new Directory(); uint nfiles = d.Load( directory, true ); if(nfiles == 0) return 1; //System.Console.WriteLine( "Files:\n" + d.toString() ); // Implement fast path ? // Scanner s = new Scanner(); string descriptor = "My_Descriptor"; FilenamesType filenames = d.GetFilenames(); gdcm.DICOMDIRGenerator gen = new DICOMDIRGenerator(); gen.SetFilenames( filenames ); gen.SetDescriptor( descriptor ); if( !gen.Generate() ) { return 1; } gdcm.FileMetaInformation.SetSourceApplicationEntityTitle( "GenerateDICOMDIR" ); gdcm.Writer writer = new Writer(); writer.SetFile( gen.GetFile() ); writer.SetFileName( outfilename ); if( !writer.Write() ) { return 1; } return 0; }
public static int Main(string[] args) { string directory = args[0]; string outfilename = args[1]; Directory d = new Directory(); uint nfiles = d.Load(directory, true); if (nfiles == 0) { return(1); } //System.Console.WriteLine( "Files:\n" + d.toString() ); // Implement fast path ? // Scanner s = new Scanner(); string descriptor = "My_Descriptor"; FilenamesType filenames = d.GetFilenames(); gdcm.DICOMDIRGenerator gen = new DICOMDIRGenerator(); gen.SetFilenames(filenames); gen.SetDescriptor(descriptor); if (!gen.Generate()) { return(1); } gdcm.FileMetaInformation.SetSourceApplicationEntityTitle("GenerateDICOMDIR"); gdcm.Writer writer = new Writer(); writer.SetFile(gen.GetFile()); writer.SetFileName(outfilename); if (!writer.Write()) { return(1); } return(0); }