Code Monkey home page Code Monkey logo

Comments (8)

MarcelBeining avatar MarcelBeining commented on May 25, 2024

Hi @naureeng ,
hard to say without having the swc file. And what do you mean with half the dendrites? Do you have region names for your tree? Do you see anything obvious when running dissect_tree with the -s option to see the sectioning?
Why was it necessary to load your swc with the -r option? What was repaired (there should be some info in the console about it)?

Best
Marcel

from treestoolbox.

naureeng avatar naureeng commented on May 25, 2024

Hello Marcel,
Our file is "FR130_1_tracing.swc" :
https://github.com/naureeng/cameraLucida/tree/master/Example_data/FR130

We do not have region names for the tree. The -s option shows good sectioning. The issue for me is in the output of:

[sect, vec] = dissect_tree(rtree);

sect does not include all the branches. The output appears as:

1 3
3 4
4 8
8 10
10 13
13 19
19 32
32 37
37 51
51 56
51 57

The first 10 pairs are continuous segments and the last pair is 51 connected to 57. When I count segments in this way, half the nodes are missed. Is there an issue with how I am interpreting the output of sect ?

There was no repair, I believe the default to the .swc file format is -r

from treestoolbox.

MarcelBeining avatar MarcelBeining commented on May 25, 2024

Hm, so when I download your swc file and execute exactly your script I get as sect:

           1           1
           1           3
           3           4
           4           8
           8          10
          10          13
          13          19
          19          32
          32          37
          37          51
          51          56
          51          57
          37          68
          37          79
          32          98
          32         108
          19         142
          13         144
         144         148
         148         171
         148         188
         144         200
          10         222
           8         225
         225         226
         226         239
         239         264
         239         279
         226         289
         225         298
         298         312
         298         324
         225         339
           4         341
         341         342
         342         344
         344         346
         346         360
         360         394
         360         398
         398         411
         398         423
         398         426
         346         443
         344         479
         342         488
         488         506
         506         507
         507         524
         507         535
         506         541
         488         556
         341         563
         563         574
         574         576
         563         583
           1         587
         587         592
         592         597
         597         598
         598         611
         598         623
         592         625
         625         640
         625         650
         587         651
         651         656
         656         657
         657         672
         657         683
         651         688
         688         703
         688         711
         587         714
         714         716
         716         726
         726         734
         716         743
         743         747
         714         763
           1         767
         767         769
         769         770
         770         775
         775         791
         775         801
         770         809
         769         815
         815         829
         829         832
         829         834
         815         841
         769         864
         767         867
         867         870
         870         885
         870         897
         867         917
           1         966
           1         969
         969         970
         970         971
         971         987
         971        1000
         970        1018
         969        1019
        1019        1022
        1022        1033
        1022        1043
        1019        1060
           1        1063
        1063        1066
        1066        1068
        1068        1086
        1068        1098
        1066        1108
        1063        1121
        1121        1124
        1121        1125
           1        1127
        1127        1130
        1130        1131
        1131        1133
        1133        1146
        1133        1152
        1131        1165
        1127        1183

What treestoolbox version are you using?

from treestoolbox.

naureeng avatar naureeng commented on May 25, 2024

Hello Marcel,

I get the same output as you. I downloaded the most recent one from github and the help line is:

'the TREES toolbox Copyright (C) 2009 - 2018 Hermann Cuntz

The issue is maybe in how I interpreting the sect output. I label each of those start:end pairs in sect as continuous or a 1-point connection. When I do this, half the points are not classified.

sect_corr = sect;
sect_classify = ones(length(sect_corr),1);

for i = 2:length(sect_corr)
    if sect_corr(i,1) == sect_corr(i-1,2)
        sect_classify(i) = 1;
    else
        sect_classify(i) = 2;
    end
end

from treestoolbox.

MarcelBeining avatar MarcelBeining commented on May 25, 2024

When I run your code, All sect_classify values have a 1 or a 2, so all the 127 sections that sect comprises have a class now. I don't get what you're missing :-)

from treestoolbox.

naureeng avatar naureeng commented on May 25, 2024

Hello Marcel,

Apologies for my late reply and not being clear! Using sect_classify, I build a list of nodes where each row is a branch. With the values of sect there are points that are not included in either the continuous (1) or 1-point segments (2). These are those points:

  • `58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 143
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 223
  • 224
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 340
  • 395
  • 396
  • 397
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
  • 421
  • 422
  • 424
  • 425
  • 427
  • 428
  • 429
  • 430
  • 431
  • 432
  • 433
  • 434
  • 435
  • 436
  • 437
  • 438
  • 439
  • 440
  • 441
  • 442
  • 444
  • 445
  • 446
  • 447
  • 448
  • 449
  • 450
  • 451
  • 452
  • 453
  • 454
  • 455
  • 456
  • 457
  • 458
  • 459
  • 460
  • 461
  • 462
  • 463
  • 464
  • 465
  • 466
  • 467
  • 468
  • 469
  • 470
  • 471
  • 472
  • 473
  • 474
  • 475
  • 476
  • 477
  • 478
  • 480
  • 481
  • 482
  • 483
  • 484
  • 485
  • 486
  • 487
  • 525
  • 526
  • 527
  • 528
  • 529
  • 530
  • 531
  • 532
  • 533
  • 534
  • 536
  • 537
  • 538
  • 539
  • 540
  • 542
  • 543
  • 544
  • 545
  • 546
  • 547
  • 548
  • 549
  • 550
  • 551
  • 552
  • 553
  • 554
  • 555
  • 557
  • 558
  • 559
  • 560
  • 561
  • 562
  • 577
  • 578
  • 579
  • 580
  • 581
  • 582
  • 584
  • 585
  • 586
  • 612
  • 613
  • 614
  • 615
  • 616
  • 617
  • 618
  • 619
  • 620
  • 621
  • 622
  • 624
  • 641
  • 642
  • 643
  • 644
  • 645
  • 646
  • 647
  • 648
  • 649
  • 673
  • 674
  • 675
  • 676
  • 677
  • 678
  • 679
  • 680
  • 681
  • 682
  • 684
  • 685
  • 686
  • 687
  • 704
  • 705
  • 706
  • 707
  • 708
  • 709
  • 710
  • 712
  • 713
  • 735
  • 736
  • 737
  • 738
  • 739
  • 740
  • 741
  • 742
  • 748
  • 749
  • 750
  • 751
  • 752
  • 753
  • 754
  • 755
  • 756
  • 757
  • 758
  • 759
  • 760
  • 761
  • 762
  • 764
  • 765
  • 766
  • 792
  • 793
  • 794
  • 795
  • 796
  • 797
  • 798
  • 799
  • 800
  • 802
  • 803
  • 804
  • 805
  • 806
  • 807
  • 808
  • 810
  • 811
  • 812
  • 813
  • 814
  • 833
  • 835
  • 836
  • 837
  • 838
  • 839
  • 840
  • 842
  • 843
  • 844
  • 845
  • 846
  • 847
  • 848
  • 849
  • 850
  • 851
  • 852
  • 853
  • 854
  • 855
  • 856
  • 857
  • 858
  • 859
  • 860
  • 861
  • 862
  • 863
  • 865
  • 866
  • 886
  • 887
  • 888
  • 889
  • 890
  • 891
  • 892
  • 893
  • 894
  • 895
  • 896
  • 898
  • 899
  • 900
  • 901
  • 902
  • 903
  • 904
  • 905
  • 906
  • 907
  • 908
  • 909
  • 910
  • 911
  • 912
  • 913
  • 914
  • 915
  • 916
  • 918
  • 919
  • 920
  • 921
  • 922
  • 923
  • 924
  • 925
  • 926
  • 927
  • 928
  • 929
  • 930
  • 931
  • 932
  • 933
  • 934
  • 935
  • 936
  • 937
  • 938
  • 939
  • 940
  • 941
  • 942
  • 943
  • 944
  • 945
  • 946
  • 947
  • 948
  • 949
  • 950
  • 951
  • 952
  • 953
  • 954
  • 955
  • 956
  • 957
  • 958
  • 959
  • 960
  • 961
  • 962
  • 963
  • 964
  • 965
  • 967
  • 968
  • 988
  • 989
  • 990
  • 991
  • 992
  • 993
  • 994
  • 995
  • 996
  • 997
  • 998
  • 999
  • 1001
  • 1002
  • 1003
  • 1004
  • 1005
  • 1006
  • 1007
  • 1008
  • 1009
  • 1010
  • 1011
  • 1012
  • 1013
  • 1014
  • 1015
  • 1016
  • 1017
  • 1034
  • 1035
  • 1036
  • 1037
  • 1038
  • 1039
  • 1040
  • 1041
  • 1042
  • 1044
  • 1045
  • 1046
  • 1047
  • 1048
  • 1049
  • 1050
  • 1051
  • 1052
  • 1053
  • 1054
  • 1055
  • 1056
  • 1057
  • 1058
  • 1059
  • 1061
  • 1062
  • 1087
  • 1088
  • 1089
  • 1090
  • 1091
  • 1092
  • 1093
  • 1094
  • 1095
  • 1096
  • 1097
  • 1099
  • 1100
  • 1101
  • 1102
  • 1103
  • 1104
  • 1105
  • 1106
  • 1107
  • 1109
  • 1110
  • 1111
  • 1112
  • 1113
  • 1114
  • 1115
  • 1116
  • 1117
  • 1118
  • 1119
  • 1120
  • 1126
  • 1147
  • 1148
  • 1149
  • 1150
  • 1151
  • 1153
  • 1154
  • 1155
  • 1156
  • 1157
  • 1158
  • 1159
  • 1160
  • 1161
  • 1162
  • 1163
  • 1164
  • 1166
  • 1167
  • 1168
  • 1169
  • 1170
  • 1171
  • 1172
  • 1173
  • 1174
  • 1175
  • 1176
  • 1177
  • 1178
  • 1179
  • 1180
  • 1181
  • 1182`

I found a way to use the adjacency matrix to fix this, so I can close this issue after your reply. Hope what I wrote was clear, many thanks for your time!

from treestoolbox.

MarcelBeining avatar MarcelBeining commented on May 25, 2024

Hi @naureeng ,
I guess what you tried to do with sect from dissect_tree is something like

for n=1:length(sect)
branchNodes{n} = sect (n,1):sec(n,2);
end

right?
This is not possible as the node IDs are not necessarily in order from branch start to branch end!
Have you looked into par_tree? This gives you a matrix of adjacent node IDs back to the root for each node. You can use it with the information from sect to find all IDs between sect(n,2) back to sect(n,1) .

from treestoolbox.

naureeng avatar naureeng commented on May 25, 2024

Yes, exactly! I did not look at par_tree but I used the adjacency matrix to identify segments. I'll take a look, thank you for your help and time!

from treestoolbox.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.