Code covered by the BSD License  

Highlights from
DICOM server connection

DICOM server connection

by

 

This script connects to a DICOM server and transfer the a dicom series to the MATLAB workspace

dcmserver_change_sortordering(sorting_ID)
function dcmserver_change_sortordering(sorting_ID)
% function dcmserver_change_sortordering(sorting_ID)
%
% Matlab library function for "dcmserver_connection.m" (see the related help).

% University of Debrecen, Institute of Nuclear Medicine
% Author: Laszlo Balkay/2010
dcmCommonData = get(findobj('tag','dcmStudyList_info'),'UserData');
if sorting_ID == 1
    [sorted_datetime,indexes] = sort(cell2mat(dcmCommonData.StudyList(:,7)),'descend'); % sort for datetime
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(indexes));
elseif  sorting_ID == 2
    [sorted_modality,indexes] = sort((dcmCommonData.StudyList(:,4))); % sort for modality 
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(indexes));
elseif sorting_ID == 3
    [sorted_patientname,indexes] = sort((dcmCommonData.StudyList(:,3))); % sort for patient name 
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(indexes));
elseif  sorting_ID == 4
    [sorted_studydescr,indexes] = sort((dcmCommonData.StudyList(:,5))); % sort for study descr. 
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(indexes));
elseif  sorting_ID == 11
    DateString = get(findobj('tag','dcmStudyList_DateTimeVal'),'string');
    selectedby =   strmatch(DateString,dcmCommonData.StudyList(:,1)); % filter by date
    [sorted_studydescr,indexes] = sort((dcmCommonData.StudyList(selectedby,3))); % sort for patient name
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(selectedby(indexes)));
    indexes = selectedby(indexes);
elseif  sorting_ID == 13
    DateString = get(findobj('tag','dcmStudyList_PatientNameVal'),'string');
    selectedby =   strmatch(DateString,dcmCommonData.StudyList(:,3)); % filter by PatName
    [sorted_studydescr,indexes] = sort((dcmCommonData.StudyList(selectedby,3))); % sort for patient name
    set(findobj('tag','dcmStudyList_popupmenu'),'string',dcmCommonData.StudyListFull(selectedby(indexes)));
    indexes = selectedby(indexes);
end
dcmCommonData.indexes = indexes;
set(findobj('tag','dcmStudyList_info'),'UserData',dcmCommonData);

Contact us