title: (fo-dicom) How can I modify and save a DICOM file to a new directory?
body: <p>I want to modify the header of a DICOM and set two tags. This works but then when I want to save it in a new file I get this Exception:</p>
  
  <pre><code>NullReferenceException: Object reference not set to an instance of an object
  Dicom.Network.NetworkManager.get_MachineName ()
  Dicom.DicomFileMetaInformation.CreateSourceApplicationEntityTitle ()
  Dicom.DicomFileMetaInformation..ctor (Dicom.DicomFileMetaInformation metaInfo)
  Dicom.DicomFile.PreprocessFileMetaInformation ()
  Dicom.DicomFile.Save (System.String fileName,   
  Dicom.IO.Writer.DicomWriteOptions options)
  DICOMConverter.addMaxMin () (at Assets/Scripts/DICOMConverter.cs:67)
  </code></pre>
  
  <p>My code of DICOMConverter.addMaxMin() is:</p>
  
  <pre><code> var dicomFile = DicomFile.Open(DICOMFilePath);
   var dicomImage = new DicomImage(dicomFile.Dataset);
   var header = DicomPixelData.Create(dicomImage.Dataset);
  
   var pixelData = PixelDataFactory.Create(header, 0);
  
   for (int x = 0; x &lt; Convert.ToInt32(dicomFile.Dataset.Get&lt;string&gt;(DicomTag.Columns)); x++)
   {
      for (int y = 0; y &lt; Convert.ToInt32(dicomFile.Dataset.Get&lt;string&gt;(DicomTag.Rows)); y++)
      {
           if (pixelData.GetPixel(x, y) &lt; minValue)
                      minValue = pixelData.GetPixel(x, y);
           if (pixelData.GetPixel(x, y) &gt; maxValue)
                      maxValue = pixelData.GetPixel(x, y);
       }
    }
  
    dicomFile.Dataset.AddOrUpdate(DicomTag.LargestImagePixelValue, Convert.ToString(maxValue));
    dicomFile.Dataset.AddOrUpdate(DicomTag.SmallestImagePixelValue, Convert.ToString(minValue));
  
    dicomFile.Save(@"newDicom"); 
  </code></pre>
  
  <p>It throws the exception always when I try to use the Save() Method.<br>
  I used for this the file operation example from <a href="https://github.com/fo-dicom/fo-dicom" rel="nofollow noreferrer">https://github.com/fo-dicom/fo-dicom</a> , but it doesn't work properly.</p>
  
  <p>Has someone an idea for a better save solution or can me explain what I am missing? </p>