iv3d-users

Text archives Help


Re: [IV3D-USERS] Implementing a Reader Parallel to UVF


Chronological Thread 
  • From: Mathieu Malaterre <mathieu.malaterre@gmail.com>
  • Cc: iv3d-users@sci.utah.edu
  • Subject: Re: [IV3D-USERS] Implementing a Reader Parallel to UVF
  • Date: Fri, 13 Jun 2014 12:20:45 +0200

hi Tom,

Thanks for your help. I can now load my volume however it produces a
weird output (data seems to be all white...).

I have a couple of questions, I could not answered from reading the
documentation. In my case my data has 4 LODs, divided into 4 raw files
on disk (for simplification):
- LOD 0 is of size (64,64,42), filesize is 688128
- LOD 1 is of size (128,128,84)
- LOD 2 is of size (256,256,168)
- LOD 3 is of size (512,512,336)

In which case, the implementation for loading the first LOD should be
very simple:

- GetRange(), I used hardcoded values. I did check those are correct
on the whole volume: [-600, 8000]
- GetBitWidth() returns 32, as I am dealing with signed integer, and
GetComponentCount() returns 1.
- GetBrickOverlapSize() returns for now UINTVECTOR3(0,0,0) (is this correct?)
- GetDomainSize() only returns for ts=0 / lod=0 a domain of (64,64,42)
and assert(0) for any other one (called only when I zoom in).
- GetLODLevelCount returns 4
- GetBrick is a very silly implementation, which does
std::ifstream::read (on LOD 0 file) into the std::vector<uint8_t>
params. reading went ok (.good()), vector was resized to proper actual
file length.
- MaxGradientMagnitude() returns for now:
-std::numeric_limits<float>::max() (could not figure out a decent
default implementation).

And upon construction I am doing:

// cstor
{
m_pHist1D.reset();
m_pHist1D.reset(new Histogram1D(
std::min(MAX_TRANSFERFUNCTION_SIZE, 1<<GetBitWidth())));
for (size_t i = 0;i<m_pHist1D->GetSize();i++) {
m_pHist1D->Set(i, 1);
}
m_pHist2D.reset();
VECTOR2<size_t> vec(256, std::min(MAX_TRANSFERFUNCTION_SIZE,
1<<GetBitWidth()));
m_pHist2D.reset(new Histogram2D(vec));
for (size_t y=0; y < m_pHist2D->GetSize().y; y++) {
for (size_t x=0; x < m_pHist2D->GetSize().x; x++) {
m_pHist2D->Set(x,y,1);
}
}

// add two bricks
{
BrickMD bmd;
FLOATVECTOR3 vBrickExtents(64,64,42);
UINTVECTOR3 vBrickVector(64,64,42);

bmd.extents = vBrickExtents;

FLOATVECTOR3 vBrickCorner(32,32,21);
bmd.center = vBrickCorner;
bmd.n_voxels = vBrickVector;

const BrickKey k = BrickKey(0, 0, 0);
AddBrick(k, bmd);
}
{
BrickMD bmd;
FLOATVECTOR3 vBrickExtents(512,512,336);
UINTVECTOR3 vBrickVector(512,512,336);

bmd.extents = vBrickExtents;

FLOATVECTOR3 vBrickCorner(256,256,168);
bmd.center = vBrickCorner;
bmd.n_voxels = vBrickVector;

const BrickKey k = BrickKey(0, 4, 0);
AddBrick(k, bmd);
}
}

This is were I am at now. Any suggestion how to diagnose what the
issue could be would be very much appreciated.

Regards


On Thu, Jun 12, 2014 at 5:45 PM, TF (mobile) <tfogal@sci.utah.edu> wrote:
> it's out of date, sorry.
>
> you probably want to derive from LinearIndexDataset (i might be slightly
> off on that name), assuming your data are completely regular.
>
> you do (probably) want to mixin FileBackedDataset, though (assuming your
> data are backed by files). See UVFDataset for an example.
>
> -tom
>
> On Jun 12, 2014 4:22 PM, Mathieu Malaterre <mathieu.malaterre@gmail.com>
> wrote:
>>
>> Dear all,
>>
>> I am starring at the documentation from:
>>
>> https://github.com/SCIInstitute/ImageVis3D/blob/master/doc/import.adoc#reader-skeleton
>>
>> The documentation states:
>>
>> "Derive the class from FileBackedDataset."
>>
>> However FileBackedDataset does not derives from Dataset, therefore it
>> is impossible to implement a Dataset *::Create() function. Is the
>> documentation outdated or am I missing something here ?
>>
>> Thanks.



--
Mathieu



Archive powered by MHonArc 2.6.18.

Top of page