Skip to content

Commit

Permalink
Update for new CsvHelper API
Browse files Browse the repository at this point in the history
  • Loading branch information
jas88 committed Jul 11, 2022
1 parent 6d70c8d commit 959c1ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Repopulator/CsvToDicomTagMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ public bool BuildMap(DicomRepopulatorOptions options, out string log)

CsvFile = options.CsvFileInfo;

using (var reader = new CsvReader(CsvFile.OpenText(), new(System.Globalization.CultureInfo.CurrentCulture)
var conf = new CsvConfiguration(System.Globalization.CultureInfo.CurrentCulture)
{
TrimOptions = TrimOptions.Trim
}))
TrimOptions=TrimOptions.Trim
};
using (var reader = new CsvReader(CsvFile.OpenText(), conf))
{
reader.Read();
var couldReadHeader = reader.ReadHeader();
Expand Down
7 changes: 4 additions & 3 deletions Repopulator/Matchers/TagMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ public TagMatcher(CsvToDicomTagMapping map, DicomRepopulatorOptions options):bas
if(_indexer == null)
throw new ArgumentException("No valid indexer could be found, there must be a column in the map for either SOP, Series or Study instance UIDs");

using var reader = new CsvReader(map.CsvFile.OpenText(), new(System.Globalization.CultureInfo.CurrentCulture)
var conf = new CsvConfiguration(System.Globalization.CultureInfo.CurrentCulture)
{
TrimOptions = TrimOptions.Trim
});
TrimOptions=TrimOptions.Trim;
};
using var reader = new CsvReader(map.CsvFile.OpenText(), conf);
while (reader.Read())
{
string key = reader[_indexer.Index];
Expand Down

0 comments on commit 959c1ce

Please sign in to comment.