Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Jan 29, 2025
1 parent ac67f15 commit a2d528c
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Rdmp.Dicom/Extraction/DicomTagToCSV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Org.BouncyCastle.Tls;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.DataFlowPipeline;
using Rdmp.Core.Repositories.Construction;
using Rdmp.Core.ReusableLibraryCode.Checks;
using Rdmp.Core.ReusableLibraryCode.Progress;
using Rdmp.Dicom.Extraction.FoDicomBased;
Expand Down Expand Up @@ -36,7 +37,11 @@ public class DicomTagToCSV : IPluginDataFlowComponent<DataTable>
[DemandsInitialization("The number of errors (e.g. failed to find/anonymise file) to allow before abandoning the extraction", DefaultValue = 100)]
public int ErrorThreshold { get; set; }

[DemandsInitialization("Determines how dicom files are written to the project output directory", TypeOf = typeof(IPutDicomFilesInExtractionDirectories), Mandatory = true)]
public Type PutterType { get; set; }

private int _errors = 0;
private DirectoryInfo _destinationDirectory;
private IPutDicomFilesInExtractionDirectories _putter;


Expand Down Expand Up @@ -67,14 +72,16 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener
fileRows.Add(file, processRow);
dicomFiles.Add((file, file));
}

_putter ??= (IPutDicomFilesInExtractionDirectories)ObjectConstructor.Construct(PutterType);

var dicomFilePaths = new AmbiguousFilePath(ArchiveRootIfAny, dicomFiles).GetDataset(FileFetchRetryLimit, FileFetchRetryTimeout, listener);
foreach (var dcm in dicomFilePaths)
{
var filepath = Path.Combine("C:\\temp\\csvtest", dcm.Item1);

var sw = new StreamWriter(filepath);
using var w = new CsvWriter(sw, System.Globalization.CultureInfo.InvariantCulture);
w.WriteRecord(
w.WriteRecords(
dcm.Item2.Dataset.SelectMany(t => Entry.ProcessTag(dcm.Item1, t))
);
}
Expand All @@ -83,6 +90,18 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener
}
}

Check failure on line 91 in Rdmp.Dicom/Extraction/DicomTagToCSV.cs

View workflow job for this annotation

GitHub Actions / package

Invalid token '}' in class, record, struct, or interface member declaration

Check failure on line 91 in Rdmp.Dicom/Extraction/DicomTagToCSV.cs

View workflow job for this annotation

GitHub Actions / package

Invalid token '}' in class, record, struct, or interface member declaration

public void Initialize(int projectNumber, DirectoryInfo destinationDirectory, IMappingRepository uidSubstitutionLookup = null)
{
//_projectNumber = projectNumber;

//_uidSubstitutionLookup = uidSubstitutionLookup ?? (UIDMappingServer == null ? null : new MappingRepository(UIDMappingServer));
_destinationDirectory = destinationDirectory;

//_deleteTags = GetDeleteTags().ToArray();

//initialized = true;
}

Check failure on line 103 in Rdmp.Dicom/Extraction/DicomTagToCSV.cs

View workflow job for this annotation

GitHub Actions / package

} expected

Check failure on line 103 in Rdmp.Dicom/Extraction/DicomTagToCSV.cs

View workflow job for this annotation

GitHub Actions / package

} expected

internal class Entry
{
public string Id { get; }
Expand Down

0 comments on commit a2d528c

Please sign in to comment.