Retrieves the attributes that describe the Modality LUT.
public Leadtools.Dicom.DicomModalityLutAttributes GetModalityLutAttributes() Public Overloads Function GetModalityLutAttributes() As Leadtools.Dicom.DicomModalityLutAttributes public Leadtools.Dicom.DicomModalityLutAttributes GetModalityLutAttributes() public DicomModalityLutAttributes getModalityLutAttributes() function Leadtools.Dicom.DicomDataSet.GetModalityLutAttributes()() public:Leadtools.Dicom.DicomModalityLutAttributes^ GetModalityLutAttributes();
Modality LUT attributes.
If the method does not find any of the attributes of the "Modality LUT Module" it will set both IsModalityLutSequence and IsRescaleSlopeIntercept to false. In this case, the rest of the members of the DicomModalityLutAttributes class are undefined. If the method finds the "Rescale Intercept" (0028,1052) and "Rescale Slope" (0028,1053) elements, it will set IsRescaleSlopeIntercept to true and populate RescaleIntercept, RescaleSlope, and RescaleType with the values retrieved from the DICOM Data Set.
If the method finds "Modality LUT Sequence" (0028,3000), it will set IsModalityLutSequence to true and populate FirstStoredPixelValueMapped, NumberOfEntries, EntryBits, LutExplanation, and LutType with the values retrieved from the DICOM Data Set.
It is prohibited by the DICOM standard for both "Rescale Intercept" and "Modality LUT Sequence" to exist in the same DICOM Data Set. However, if this method encounters such a Data Set, it will ignore "Modality LUT Sequence" and assume that only "Rescale Intercept" exists.
This example will extract the modality LUT information from a DICOM dataset.
using Leadtools;using Leadtools.Dicom;public void TestGetModalityLutAttributes(){string dicomFileName = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm");//Make sure to initialize the DICOM engine, this needs to be done only once//In the whole applicationDicomEngine.Startup();using (DicomDataSet ds = new DicomDataSet()){//Load DICOM Fileds.Load(dicomFileName, DicomDataSetLoadFlags.None);DicomModalityLutAttributes modalityLutAttributes = ds.GetModalityLutAttributes();if (modalityLutAttributes != null && modalityLutAttributes.IsModalityLutSequence){int[] ModalityLutData = ds.GetModalityLutData();}}DicomEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.DicomPublic Sub TestGetModalityLutAttributes()Dim dicomFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")'Make sure to initialize the DICOM engine, this needs to be done only once'In the whole applicationDicomEngine.Startup()Dim ds As DicomDataSet = New DicomDataSet()Using (ds)'Load DICOM Fileds.Load(dicomFileName, DicomDataSetLoadFlags.None)Dim modalityLutAttributes As DicomModalityLutAttributes = ds.GetModalityLutAttributes()If Not modalityLutAttributes Is Nothing AndAlso modalityLutAttributes.IsModalityLutSequence ThenDim ModalityLutData As Integer() = ds.GetModalityLutData()End IfEnd UsingDicomEngine.Shutdown()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools;using Leadtools.Dicom;using Leadtools.Examples;public void TestGetModalityLutAttributes(Stream dicomStream){//Make sure to initialize the DICOM engine, this needs to be done only once//In the whole applicationDicomEngine.Startup();using (DicomDataSet ds = new DicomDataSet()){//Load DICOM Fileds.Load(dicomStream, DicomDataSetLoadFlags.None);DicomModalityLutAttributes modalityLutAttributes = ds.GetModalityLutAttributes();if (modalityLutAttributes != null && modalityLutAttributes.IsModalityLutSequence){int[] ModalityLutData = ds.GetModalityLutData();}}DicomEngine.Shutdown();}
Imports LeadtoolsImports Leadtools.DicomPublic Sub TestGetModalityLutAttributes(ByVal dicomStream As Stream)'Make sure to initialize the DICOM engine, this needs to be done only once'In the whole applicationDicomEngine.Startup()Using ds As DicomDataSet = New DicomDataSet()'Load DICOM Fileds.Load(dicomStream, DicomDataSetLoadFlags.None)Dim modalityLutAttributes As DicomModalityLutAttributes = ds.GetModalityLutAttributes()If Not modalityLutAttributes Is Nothing AndAlso modalityLutAttributes.IsModalityLutSequence ThenDim ModalityLutData As Integer() = ds.GetModalityLutData()End IfEnd UsingDicomEngine.Shutdown()End Sub
|
Products |
Support |
Feedback: GetModalityLutAttributes() Method - Leadtools.Dicom |
Introduction |
Help Version 19.0.2017.6.16
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.