Skip to content

merge_atlases does not remove overlapping regions #37

Description

@yonestar

If two atlas being merged contain an overlapping set of regions, the merged atlas contains double copies of this region.

Toy example that reproduces the bug:

atlas_obj = load_atlas('canlab2018_2mm');
amy = select_atlas_subset(atlas_obj, {'Amy'})
double_amy = merge_atlases(amy, amy)

% check result
double_amy.labels

ans =

  1×8 cell array

    {'Amygdala_CM_'}    {'Amygdala_SF_'}    {'Amygdala_AStr_'}    {'Amygdala_LB_'}    {'Amygdala_CM_'}    {'Amygdala_SF_'}    {'Amygdala_AStr_'}    {'Amygdala_LB_'}

The 'always_replace' and the 'noreplace' options to merge_atlases do not address this.

I hesitate to try and fix because there already seems to be a complex logic regarding the 'always_replace' and the 'noreplace' options, and I am unsure how this would intersect with the issue reported here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions