You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
caused problem with files who has RescaleSlope/Intercept, but no value provided. better to change it like..
if (!dataset.TryGetSingleValue(DicomTag.RescaleSlope, out var rescaleSclope))
{
if (!functional.TryGetSingleValue(DicomTag.RescaleSlope, out rescaleSclope))
{
rescaleSclope = 1.0;
}
}
if (!dataset.TryGetSingleValue<double>(DicomTag.RescaleIntercept, out var rescaleIntercept))
{
if (!functional.TryGetSingleValue<double>(DicomTag.RescaleIntercept, out rescaleIntercept))
{
rescaleIntercept = 1.0;
}
}
var options = new GrayscaleRenderOptions(bits)
{
RescaleSlope = rescaleSclope,
RescaleIntercept = rescaleIntercept,
WindowWidth = windowWidth,
WindowCenter = windowCenter,
VOILUTFunction = voiLutFunction,
ColorMap = GetColorMap(dataset)
};
Recent update on the code..
`
var options = new GrayscaleRenderOptions(bits)
{
RescaleSlope = dataset.Contains(DicomTag.RescaleSlope)
? dataset.GetSingleValue(DicomTag.RescaleSlope)
: functional.Contains(DicomTag.RescaleSlope)
? functional.GetSingleValue(DicomTag.RescaleSlope)
: 1.0,
RescaleIntercept = dataset.Contains(DicomTag.RescaleIntercept)
? dataset.GetSingleValue(DicomTag.RescaleIntercept)
: functional.Contains(DicomTag.RescaleIntercept)
? functional.GetSingleValue(DicomTag.RescaleIntercept)
: 0.0,
caused problem with files who has RescaleSlope/Intercept, but no value provided. better to change it like..
if (!dataset.TryGetSingleValue(DicomTag.RescaleSlope, out var rescaleSclope))
{
if (!functional.TryGetSingleValue(DicomTag.RescaleSlope, out rescaleSclope))
{
rescaleSclope = 1.0;
}
}
`
Sample problematic file attached.
RescaleTag.zip
The text was updated successfully, but these errors were encountered: