diff --git a/DCMTKQueryNode.h b/DCMTKQueryNode.h index 7edcd901b8..56a6df307c 100644 --- a/DCMTKQueryNode.h +++ b/DCMTKQueryNode.h @@ -79,7 +79,7 @@ - (DCMCalendarDate *)time; - (NSString *)modality; - (NSNumber *)numberImages; -- (NSMutableArray *)children; +- (NSArray *)children; - (void) setChildren: (NSArray *) c; - (void)purgeChildren; - (void)addChild:(DcmDataset *)dataset; diff --git a/DCMTKQueryNode.mm b/DCMTKQueryNode.mm index 9ffdf943e3..d9fe4bc315 100644 --- a/DCMTKQueryNode.mm +++ b/DCMTKQueryNode.mm @@ -518,7 +518,7 @@ - (NSString *)modality{ - (NSNumber *)numberImages{ return _numberImages; } -- (NSMutableArray *)children +- (NSArray *)children { @synchronized( _children) { @@ -977,8 +977,6 @@ - (void) WADORetrieve: (DCMTKStudyQueryNode*) study // requestService: WFIND? N2LogExceptionWithStackTrace(e); } - NSMutableArray *urlToDownload = [NSMutableArray array]; - if( [self isKindOfClass:[DCMTKStudyQueryNode class]]) { // We are at STUDY level, and we want to go direclty to IMAGE level @@ -1013,6 +1011,7 @@ - (void) WADORetrieve: (DCMTKStudyQueryNode*) study // requestService: WFIND? [_children removeAllObjects]; } + NSMutableArray *urlToDownload = [NSMutableArray array]; @try { childrenArray = [childrenArray sortedArrayUsingDescriptors: [NSArray arrayWithObjects: [NSSortDescriptor sortDescriptorWithKey: @"seriesInstanceUID" ascending: YES], nil]]; @@ -1043,8 +1042,6 @@ - (void) WADORetrieve: (DCMTKStudyQueryNode*) study // requestService: WFIND? self.countOfSuboperations += urlToDownload.count; self.countOfSuccessfulSuboperations += downloader.countOfSuccesses; - - [urlToDownload removeAllObjects]; } } @@ -1067,6 +1064,8 @@ - (void) WADORetrieve: (DCMTKStudyQueryNode*) study // requestService: WFIND? childrenArray = [self children]; } + NSMutableArray *urlToDownload = [NSMutableArray array]; + @try { for( DCMTKQueryNode *image in childrenArray) diff --git a/DCMTKStudyQueryNode.mm b/DCMTKStudyQueryNode.mm index a1ce8e2337..9d88af8e70 100644 --- a/DCMTKStudyQueryNode.mm +++ b/DCMTKStudyQueryNode.mm @@ -398,7 +398,7 @@ - (id)valueForUndefinedKey:(NSString *)key return nil; } -- (NSMutableArray*)children // instead of sorting after every addChild, we sort when the array is requested +- (NSArray*)children // instead of sorting after every addChild, we sort when the array is requested { @synchronized( _children) {