MoveFirstVR Example for C++ 6.0 and later
m_pLEADDicomDS->MoveFirstVR ();
DisplayVRItem();
AfxMessageBox("wait");
m_pLEADDicomDS->MoveNextVR ();
DisplayVRItem();
AfxMessageBox("wait");
m_pLEADDicomDS->MoveLastVR ();
DisplayVRItem();
AfxMessageBox("wait");
m_pLEADDicomDS->MovePrevVR ();
DisplayVRItem();
AfxMessageBox("wait");
void CDicomDlg::DisplayVRItem()
{
short nRestrict;
CString szOut;
IDicomVRItemPtr pCurrentVR=NULL;
pCurrentVR = m_pLEADDicomDS->GetCurrentVR();
//display the items information
switch(pCurrentVR->GetCode())
{
case VR_AE:
m_Text1.SetWindowText("AE");
break;
case VR_AS:
m_Text1.SetWindowText("AS");
break;
case VR_AT:
m_Text1.SetWindowText("AT");
break;
case VR_CS:
m_Text1.SetWindowText("CS");
break;
case VR_DA:
m_Text1.SetWindowText("DA");
break;
case VR_DS:
m_Text1.SetWindowText("DS");
break;
case VR_DT:
m_Text1.SetWindowText("DT");
break;
case VR_FD:
m_Text1.SetWindowText("FD");
break;
case VR_FL:
m_Text1.SetWindowText("FL");
break;
case VR_IS:
m_Text1.SetWindowText("IS");
break;
case VR_LO:
m_Text1.SetWindowText("LO");
break;
case VR_LT:
m_Text1.SetWindowText("LT");
break;
case VR_OB:
m_Text1.SetWindowText("OB");
break;
case VR_OW:
m_Text1.SetWindowText("OW");
break;
case VR_PN:
m_Text1.SetWindowText("PN");
break;
case VR_SH:
m_Text1.SetWindowText("SH");
break;
case VR_SL:
m_Text1.SetWindowText("SL");
break;
case VR_SQ:
m_Text1.SetWindowText("SQ");
break;
case VR_SS:
m_Text1.SetWindowText("SS");
break;
case VR_ST:
m_Text1.SetWindowText("ST");
break;
case VR_TM:
m_Text1.SetWindowText("TM");
break;
case VR_UI:
m_Text1.SetWindowText("UI");
break;
case VR_UL:
m_Text1.SetWindowText("UL");
break;
case VR_UN:
m_Text1.SetWindowText("UN");
break;
case VR_US:
m_Text1.SetWindowText("US");
break;
case VR_UT:
m_Text1.SetWindowText("UT");
break;
default:
szOut.Format("%d", pCurrentVR->GetCode());
m_Text1.SetWindowText(szOut);
break;
}
m_Text2.SetWindowText(pCurrentVR->GetName());
szOut.Format("%d", pCurrentVR->GetLength());
m_Text3.SetWindowText(szOut);
nRestrict = pCurrentVR->GetRestrict();
nRestrict &= ~DICOM_VR_BINARY;
nRestrict &= ~DICOM_VR_STRING;
nRestrict &= ~DICOM_VR_TEXT;
switch(nRestrict)
{
case DICOM_VR_FIXED:
m_Text4.SetWindowText("Fixed");
break;
case DICOM_VR_MAXIMUM:
m_Text4.SetWindowText("Maximum");
break;
case DICOM_VR_MAXIMUM_GROUP:
m_Text4.SetWindowText("Maximum Group");
break;
case DICOM_VR_ANY:
m_Text4.SetWindowText("Any Length");
break;
case DICOM_VR_NOT_APPLICABLE:
m_Text4.SetWindowText("Not Applicable");
break;
case DICOM_VR_MAX:
m_Text4.SetWindowText("Max");
break;
default:
szOut.Format("%d", pCurrentVR->GetRestrict());
m_Text4.SetWindowText(szOut);
break;
}
szOut.Format("%d", pCurrentVR->GetUnitSize());
m_Text5.SetWindowText(szOut);
}