Skip to content

Commit

Permalink
Merge pull request #336 from open-ephys/miniscope-minor
Browse files Browse the repository at this point in the history
Added note explaining visual flicker for U10 data in minsicope
  • Loading branch information
bparks13 authored Oct 17, 2024
2 parents e49b3e1 + 5c14e0b commit d65244b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions OpenEphys.Onix1/ConfigureUclaMiniscopeV4Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ internal static void ConfigureDeserializer(DeviceContext device)
DS90UB9x.Initialize933SerDesLink(device, DS90UB9xMode.Raw12BitLowFrequency);

var deserializer = new I2CRegisterContext(device, DS90UB9x.DES_ADDR);

uint i2cAlias = UclaMiniscopeV4.AtMegaAddress << 1;
deserializer.WriteByte((uint)DS90UB9xDeserializerI2CRegister.SlaveID1, i2cAlias);
deserializer.WriteByte((uint)DS90UB9xDeserializerI2CRegister.SlaveAlias1, i2cAlias);
Expand All @@ -213,14 +213,10 @@ internal static void ConfigureSerializer(DeviceContext device)

internal static void ConfigureCameraSystem(DeviceContext device, UclaMiniscopeV4FramesPerSecond frameRate, bool interleaveLed)
{
const int WaitUntilPllSettles = 200;

// set up Python480
var atMega = new I2CRegisterContext(device, UclaMiniscopeV4.AtMegaAddress);
WriteCameraRegister(atMega, 16, 3); // Turn on PLL
//Thread.Sleep(WaitUntilPllSettles); //This sometimes has good effects, sometimes adverse, we just might want to redo this entire section (see issue #331 )
WriteCameraRegister(atMega, 32, 0x7007); // Turn on clock management
//Thread.Sleep(WaitUntilPllSettles);
WriteCameraRegister(atMega, 199, 666); // Defines granularity (unit = 1/PLL clock) of exposure and reset_length
WriteCameraRegister(atMega, 200, 3300); // Set frame rate to 30 Hz
WriteCameraRegister(atMega, 201, 3000); // Set Exposure
Expand Down
13 changes: 7 additions & 6 deletions OpenEphys.Onix1/UclaMiniscopeV4CameraData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ public class UclaMiniscopeV4CameraData : Source<UclaMiniscopeV4CameraFrame>
/// Gets or sets the data type used to represent pixel intensity values.
/// </summary>
/// <remarks>
/// The UCLA Miniscope V4 uses a 10-bit image sensor. To capture images that use the full
/// ADC resolution, this value can be set to <see cref="UclaMiniscopeV4ImageDepth.U10"/>.
/// This comes at the cost of limited codec support and larger file sizes. If <see
/// cref="UclaMiniscopeV4ImageDepth.U8"/> is selected, the two least significant bits of
/// each pixel sample will be discarded, which greatly increases codec options and reduces
/// file sizes.
/// The UCLA Miniscope V4 uses a 10-bit image sensor. To capture images that use the full ADC
/// resolution, this value can be set to <see cref="UclaMiniscopeV4ImageDepth.U10"/>. This comes at
/// the cost of limited codec support and larger file sizes. If <see
/// cref="UclaMiniscopeV4ImageDepth.U8"/> is selected, the two least significant bits of each pixel
/// sample will be discarded, which greatly increases codec options and reduces file sizes. Further,
/// we have noticed that Bonsai introduces flickering in the real-time video visualizer when using
/// 10-bit data. These artifacts are not present in the data itself, only in the real-time visualizer.
/// </remarks>
[Description("The bit-depth used to represent pixel intensity values.")]
[Category(DeviceFactory.ConfigurationCategory)]
Expand Down

0 comments on commit d65244b

Please sign in to comment.