Esempio n. 1
0
    public static int Main(string[] args)
    {
        string filename    = args[0];
        string outfilename = args[1];

        gdcm.FileAnonymizer fa = new gdcm.FileAnonymizer();
        fa.SetInputFileName(filename);
        fa.SetOutputFileName(outfilename);

        // Empty Operations
        // It will create elements, since those tags are non-registered public elements (2011):
        fa.Empty(new Tag(0x0008, 0x1313));
        fa.Empty(new Tag(0x0008, 0x1317));
        // Remove Operations
        // The following Tag are actually carefully chosen, since they refer to SQ:
        fa.Remove(new Tag(0x0008, 0x2112));
        fa.Remove(new Tag(0x0008, 0x9215));
        // Replace Operations
        // do not call replace operation on SQ attribute !
        fa.Replace(new Tag(0x0018, 0x5100), "MYVALUE ");
        fa.Replace(new Tag(0x0008, 0x1160), "MYOTHERVAL");

        if (!fa.Write())
        {
            System.Console.WriteLine("Could not write");
            return(1);
        }

        return(0);
    }
Esempio n. 2
0
  public static int Main(string[] args)
    {
    string filename = args[0];
    string outfilename = args[1];

    gdcm.FileAnonymizer fa = new gdcm.FileAnonymizer();
    fa.SetInputFileName( filename );
    fa.SetOutputFileName( outfilename );

    // Empty Operations
    // It will create elements, since those tags are non-registered public elements (2011):
    fa.Empty( new Tag(0x0008,0x1313) );
    fa.Empty( new Tag(0x0008,0x1317) );
    // Remove Operations
    // The following Tag are actually carefully chosen, since they refer to SQ:
    fa.Remove( new Tag(0x0008,0x2112) );
    fa.Remove( new Tag(0x0008,0x9215) );
    // Replace Operations
    // do not call replace operation on SQ attribute !
    fa.Replace( new Tag(0x0018,0x5100), "MYVALUE " );
    fa.Replace( new Tag(0x0008,0x1160), "MYOTHERVAL" );

    if( !fa.Write() )
      {
      System.Console.WriteLine( "Could not write" );
      return 1;
      }

    return 0;
    }
Esempio n. 3
0
 static private void CreateBigDICOM(string fileName, string outfilename)
 {
     using (var ano = new gdcm.FileAnonymizer())
     {
         // The following is somewhat dangerous, do not try at home:
         string nframes = "1000";
         ano.Replace(new gdcm.Tag(0x0028, 0x0008), nframes);
         ano.SetInputFileName(fileName);
         ano.SetOutputFileName(outfilename);
         ano.Write(); // at this point the DICOM is invalid !
     }
 }
Esempio n. 4
0
 private static void CreateBigDICOM(string fileName, string outfilename)
 {
     using( var ano = new gdcm.FileAnonymizer() )
       {
       // The following is somewhat dangerous, do not try at home:
       string nframes = "1000";
       ano.Replace( new gdcm.Tag(0x0028,0x0008), nframes );
       ano.SetInputFileName(fileName);
       ano.SetOutputFileName(outfilename);
       ano.Write(); // at this point the DICOM is invalid !
       }
 }