private void processStudies(string parentDir) { DicomUpdate dicomUpdate = new DicomUpdate(); foreach (string dirs in Directory.GetDirectories(parentDir)) { string dirName = Path.GetFileName(dirs); string targetOutputDirectory = _targetDir + "\\New_" + dirName; Directory.CreateDirectory(targetOutputDirectory); foreach (string file in Directory.GetFiles(dirs, "*", SearchOption.AllDirectories)) { FileInfo fileInfo = new FileInfo(file); toolstripStatuslbl.Text = "Copying file " + fileInfo.Name; if (fileInfo.Extension == ".dcm") { fileInfo.CopyTo(targetOutputDirectory + "\\" + fileInfo.Name, true); } } toolstripStatuslbl.Text = "Creating Update Objects"; List<UpdateData> updateObjects = generateUpdateObjectList(targetOutputDirectory); foreach (UpdateData update in updateObjects) { toolstripStatuslbl.Text = "Should be updating now..."; dicomUpdate.UpdateDicomFile(update); } } toolstripStatuslbl.Text = "Done"; }
private void btnUpdate_Click(object sender, EventArgs e) { DicomUpdate updateTargetFile = new DicomUpdate(); if (chkboxApplyToAllFiles.Checked == true) { string[] studyFiles; string parentDir = Directory.GetParent(_updateTargetFile).FullName; studyFiles = Directory.GetFiles(parentDir); foreach (string file in studyFiles) { if (file.EndsWith(".dcm")) { updateTargetFile.UpdateDicomFile(file, _dicomTag, txtboxNewValue.Text); } } lblStatusMsg.Text = "Dicom element " + _dicomTag + "," + _dicomElementName + " updated for all files"; txtboxNewValue.Text = ""; } else { updateTargetFile.UpdateDicomFile(_updateTargetFile, _dicomTag, txtboxNewValue.Text); lblStatusMsg.Text = "Dicom element " + _dicomTag + "," + _dicomElementName + " updated"; lblDicomValueOriginal.Text = txtboxNewValue.Text; txtboxNewValue.Text = ""; } }
public void UpdateDicomFileTest() { DicomUpdate target = new DicomUpdate(); UpdateData updateData = new UpdateData(); string[] files; string path = ".\\Monodicom.Tests\\TestStudies\\RFStudy"; updateData.DicomFilePath = path; files = Directory.GetFiles(path, ".dcm"); target.UpdateDicomFile(updateData); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void UpdateDicomFileTest1() { DicomUpdate target = new DicomUpdate(); // TODO: Initialize to an appropriate value string updateFile = string.Empty; // TODO: Initialize to an appropriate value string dicomTag = string.Empty; // TODO: Initialize to an appropriate value string newValue = string.Empty; // TODO: Initialize to an appropriate value target.UpdateDicomFile(updateFile, dicomTag, newValue); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void DicomUpdateConstructorTest() { DicomUpdate target = new DicomUpdate(); string dicomUpdateObject = target.ToString(); Assert.AreNotEqual("", dicomUpdateObject); }