Conversion String -> Byte Array

Hi!

I am using the ZIP XOP (http://www.igorexchange.com/project/ZIP) to access zipped images that are saved in a proprietary data format. For that purpose I am reading strings from those data files and then decode them using zipdecode(str). After that process I have a (longer) string that contains all my image data (1280x1024 Pixel = 1.3 million pixels!) that I convert to a 2D-wave by using char2num for every single pixel. This process is very slow. Is there any other faster way to convert a long string (> 1 MB) into a byte array (wave)?

Thanks,
Alexander
It can be done, very very easily. Thanks for the feedback on zip by the way (I wrote it). Install the SOCKIT xop, also on IgorExchange. There is an operation in the xop called SOCKITstringtowave. This will do what you want.

Usage:
string myunzipped = zipdecode(myzipped)
//the following assumes a signed byte wavetype, look up wavetype for details
sockitstringtowave 8, myunzipped
Wave W_stringtowave


Then all you need to do is redimension/rename/duplicate. This operation will be very fast
andyfaff wrote:
It can be done, very very easily. Thanks for the feedback on zip by the way (I wrote it). Install the SOCKIT xop, also on IgorExchange. There is an operation in the xop called SOCKITstringtowave. This will do what you want.

Usage:
string myunzipped = zipdecode(myzipped)
//the following assumes a signed byte wavetype, look up wavetype for details
sockitstringtowave 8, myunzipped
Wave W_stringtowave


Then all you need to do is redimension/rename/duplicate. This operation will be very fast


Thanks! That works great!