Neural-Systems-at-UIO / Atlas-support

Issue-tracker repository for requests-questions related to HBP atlases
1 stars 2 forks source link

Merger enhancements #4

Open Tevemadar opened 4 years ago

Tevemadar commented 4 years ago

delete labels mask with labels

Tevemadar commented 4 years ago

Available for testing from NESYS_Tools\Merger

Example:

...
file something.nii.gz
mask 58 63
map 0 -> 0
map 72 -> -1
map 73 -> 80

will overwrite structure identifiers 58 and 63 only, remapping 72 to 0, 73 to 80 and ignoring zeros (where something.nii.gz contains a zero, the original 58 or 63 will be preserved). Merger still expects a mapping for all identifiers present in the input files, here they are cut away for the sake of brevity.

aeidi89 commented 3 years ago

@Tevemadar

I've tried to test the masking feature of the merger. To my knowledge I followed the instructions (seen above) but the mask function did not work for me.

In words, this it what I tried and what I achieved: I wanted to mask label #92 so that this would be the only label overwritten by label #82. In the text file I wrote this as follows:

file something.nii.gz\ mask 92\ map 0 -> 0\ ....\ map 82 -> 82\ ....

I did not get the result I expected and it looked like nothing happend after the merge was done. The files I used were called "...masking".

I managed to get my desired result by doing several merges forth and back between the files I worked on, files called "...masking2"

You can find the files at this path: Z:\WHS_Rat_Brain_Atlas\WHS-v4\01_working-environment\04_Merging\2021.02_Merging_WHS-v4-test_HK

Do you have any thoughts on what I did wrong when trying to use the mask or why it didn't work?

aeidi89 commented 3 years ago

@Tevemadar and/or @eapapp

I have run into an issue when merging and I don't seem to be able to troubleshoot it myself.

Issue: I am merging together two files, a cx-file (containing basal ganglia, cx and pirifom structures) and a th-file (containing thalamus structures). I have set up 6 steps for this merging, with the cx-file as base. In short these are the steps: 1) map base: cx-file, 2) revision of old structures: th-file, 3) adding thalamus structures: th-file, 4) re-adding basal ganglia and cx structures: cx-file, 5) mask for specific structure, and 6) re-adding structures from WHS-v3.

Step 1-3 works fine but the merger will not run at step 4.

Files and path to files: Z:\WHS_Rat_Brain_Atlas\WHS-v4\01_working-environment\04_Merging\2021.03_Merging_HK File explanation:

I hope you can help me with this.

Tevemadar commented 3 years ago

@aeidi89 I'm extremely sorry about not looking at this sooner. Lines 1691 and 1692 of mapping_test3.txt both map label 180 (to 0 in this case). Remove one of them. Files mapping_test3_fixed.txt and merge_test3_fixed.bat may do the job.