Skip to content

Commit

Permalink
Merge pull request #678 from PaulHax/convert-to-seg
Browse files Browse the repository at this point in the history
Use DICOM series number to match with image seg files
  • Loading branch information
PaulHax authored Oct 25, 2024
2 parents 2652cfb + 9fb1d02 commit 49edb19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/actions/loadUserFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ function filterMatchingNames(
succeeded: Array<PipelineResultSuccess<ImportResult>>,
extension: string
) {
const primaryName = getDataSourceName(primaryDataSource.dataSource);
const dicomStore = useDICOMStore();
const primaryName =
primaryDataSource.dataType === 'dicom'
? dicomStore.volumeInfo[primaryDataSource.dataID].SeriesNumber
: getDataSourceName(primaryDataSource.dataSource);
if (!primaryName) return [];
const primaryNamePrefix = primaryName.split('.').slice(0, 1).join();
return filterLoadableDataSources(succeeded)
Expand Down
4 changes: 3 additions & 1 deletion src/store/segmentGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ export const useSegmentGroupStore = defineStore('segmentGroup', () => {
);
}

// cache name before deleting
const baseName = imageStore.metadata[imageID].name;

// Don't remove image if DICOM. User may have selected segment group image as primary selection by now
const deleteImage = isRegularImage(imageID);
if (deleteImage) {
Expand All @@ -318,7 +321,6 @@ export const useSegmentGroupStore = defineStore('segmentGroup', () => {
const images =
componentCount === 1 ? [childImage] : extractEachComponent(childImage);

const baseName = imageStore.metadata[imageID].name;
images.forEach(async (image, component) => {
const matchingParentSpace = await ensureSameSpace(
parentImage,
Expand Down

0 comments on commit 49edb19

Please sign in to comment.