--[[
	This script handles sequence sorting for OT, RG, RTIMAGE, SC, 
	BI, CS, DG, DM, EC, ECG, EPS, ES, FA, FS, GM, IO, PX, SM, ST, TG, XC,
	and similiar modality images which will be still frames only and consist
	of a small number of images.
     
    This script generates the hints for sorting the  sequences within the study
    "single image" sequences first, "all images" sequence last 
    
     Allan Noordvyk		January 19, 2005       
	-	Created based on old SortBI version 
	Mahesh Nagarajan	January 31, 2007
	- 	Modified syntaxes for sorting hints as part of v11.5 re-write
	-	Site customized code will be removed and re-located to SortGenericSingleStillCT.site 
		files -> starting with 11.5, unless sort orders are fundamentally flawed, all change 
		requests to sorting schemes will be incorporated into a site file for the site.	    
--]]

-- ////////////////////////////////////////////////////////////////////////////
-- Generic Still sorting function
-- ////////////////////////////////////////////////////////////////////////////

function Execute()

    -- Note that since this is a generic script covering multiple modalities
    -- we do not do a modality sanity check.
	
    local sortHint01 = SortingHint:new("Still Sequence Sort", "DEFAULT")
    
    sortHint01:AddEntry(IMAGE_UID_TAG) -- make sure the "all images" comes last 

    -- Beyond that, simply chronological
    sortHint01:AddEntry(SERIES_DATE_TAG)
    sortHint01:AddEntry(SERIES_TIME_TAG)
    sortHint01:AddEntry(SERIES_NUMBER_TAG)
    sortHint01:AddEntry(PHASE_PROP)    
    sortHint01:AddEntry(ACQ_NUMBER_TAG)   
    
    -- Ensure some unique order even if all time is the same
    sortHint01:AddEntry(SERIES_UID_TAG)
        
    SortSequencesInStudy(sortHint01) 
end

