barbaLab / nigeLab

Neurophysiological data analyses by engineers, for physiologists.
GNU General Public License v3.0
14 stars 2 forks source link

[BUG] Bad initialization of channel mask on Tank construction #30

Closed m053m716 closed 4 years ago

m053m716 commented 5 years ago

Bug Report

Description

In the myTank dataset, the first block in the recording only uses 32 channels. Most of the other blocks use 64 channels; however, when I initialize as

myTank = nigeLab.Tank('RecDir','C:\Temp\tmp_in\myTank','SaveLoc','C:\Temp\tmp_out');

Even the 64-channel blocks only have data in 32 channels, although 64 files are extracted. I think something is wrong with setting the mask during tank initialization.

Error Messages

As a result, if I try to run doUnitFilter, I get the following error:

doUnitFilter(myTank.Animals(1).Blocks(3));

Applying bandpass filtering...050%
Struct contents reference from a non-struct array object.

Error in nigeLab.Block/doUnitFilter (line 42)
if blockObj.Channels(iCh).Raw.length <= nfact

and

myTank.Animals(1).Blocks(3).Channels(33)

ans = 

  struct with fields:

              native_channel_name: 'B-000'
              custom_channel_name: 'B-000'
                     native_order: 0
                     custom_order: 2
                     board_stream: 2
                     chip_channel: 0
                        port_name: 'Port B'
                      port_prefix: 'B'
                      port_number: 2
    electrode_impedance_magnitude: 411373.25
        electrode_impedance_phase: -62.3212547302246
                      signal_type: 'Raw'
                            probe: 3
                            chNum: 0
                            chStr: '000'
                              Raw: []
                               DC: []
                             Filt: []

Despite:

image

Machine