Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Data conversion for raw volumes #356

Merged
merged 2 commits into from
Dec 19, 2016
Merged

Data conversion for raw volumes #356

merged 2 commits into from
Dec 19, 2016

Conversation

eile
Copy link
Contributor

@eile eile commented Dec 15, 2016

No description provided.

Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks ok, but could you please add in the commit message and documentation what is the expected benefit of this feature from a user perspective? Even after reviewing it I have no idea how or why I would want to use that. Is a very lossy way to save some GPU memory?

* with format being one of: char, int8, unsigned char, uint8, short, int16,
* unsigned short, uint16, int, int32, unsigned int,
* uint32, float
* with formats being one of: char, int8, unsigned char, uint8, short, int16,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not clear now, please rename formats. does it refer to format or inputFormat from the line above?
When should one specify the inputFormat, when is it optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format is for both. Changed to 'input format' and documented defaults

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just (?output=format) which should be inside () just like (,input format) to show that it is optional

if( _inputType == DT_UINT32 && _outputType == DT_UINT8 )
return _scale< uint8_t, uint32_t >( ptr, size );
if( _inputType == DT_UINT32 && _outputType == DT_UINT16 )
return _scale< uint16_t, uint32_t >( ptr, size );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverse the order: template< class O, class I > -> template< class I, class O> so that it reads in the logical order (uint32_t ->uint16_t ) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

eile pushed a commit to eile/Livre that referenced this pull request Dec 16, 2016
@eile
Copy link
Contributor Author

eile commented Dec 16, 2016

Even after reviewing it I have no idea how or why I would want to use that

How is hopefully clear from the doxygen. Why: If you need it, you'll find it. This is only an increment to a full solution, which I needed to render a uint16 data set. The pressing issue was that this produces a black image today in Livre (and @chevtche was not around), but it also is faster since it uses 1.5GB instead of 3GB. Visually I would guess it doesn't make a big difference, since the images I got are very nice already. And 1.5 vs 3GB is also a bit more then 'some GPU memory' ;).

The full solution would be a generic decorator for all data source doing the conversion, but this is a bigger can of worms.

Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the information, I was missing parts of that. Having it in the commit message makes the reviewer's life easier than trying to reverse-engineer the programmer's intentions :-) And in this case the doxygen changes were rather minimalistic. As you also point out, the uses cases for this feature are limited, and mostly motivated as a work-around for a rendering bug. The memory gain offered by the requantization only helps if the input volume is in the range [1x; 2x] the GPU memory, beyond that an LOD structure is needed anyway. And not all volumes will support such a hard compression. It is probably fine on very continuous fields such as LFP, but could have bad effects on a medical image stack where the extra bits code for different types of tissue or structures. It is probably better to change the volume generation toolchain to output an 8-bit volume directly in the cases where the 16-bits of precision are not necessary, but I guess that's up to the user in the end.

* with format being one of: char, int8, unsigned char, uint8, short, int16,
* unsigned short, uint16, int, int32, unsigned int,
* uint32, float
* with formats being one of: char, int8, unsigned char, uint8, short, int16,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, just (?output=format) which should be inside () just like (,input format) to show that it is optional

@chevtche
Copy link
Contributor

chevtche commented Dec 19, 2016

Maybe we should fix the 16-bit bug instead of downscaling ? It's very sad to lose informations...

I just tested 16-bit volume with the memory data source and it's working. I think the bug is in the raw datasource loader.

@eile
Copy link
Contributor Author

eile commented Dec 19, 2016

Both. Sometimes downscaling is no issue, as the visual result is still good enough at 2x the performance:

beechnut

@eile eile merged commit 9872c9d into BlueBrain:master Dec 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants