How to Write Custom OpenZoom Descriptors?
Hi all,
I'm working on a custom descriptor for openzoom, but I still have some problems showing images. My code looks like (in the "script" part of mxml file):
// data is of type XML derived from the parsing of the path,
//CustomDescriptor extends MultiScaleImageDescriptorBase and implements IMultiScaleImageDescriptor
var customDescr:CustomDescriptor = new CustomDescriptor ('somepath/descriptionfile.RDF',data)
var image:MultiScaleImage = new MultiScaleImage();
image.source = customDescr;
the execution gives the following error:
TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
at org.openzoom.flex.components::MultiScaleImage/addImage()[/Users/dani/Documents/workspace/openzoom/src/main/flash/org/openzoom/flex/components/MultiScaleImage.as:413]
at org.openzoom.flex.components::MultiScaleImage/set source()[/Users/dani/Documents/workspace/openzoom/src/main/flash/org/openzoom/flex/components/MultiScaleImage.as:144]
at test_descriptor5/eslideDescr()[C:\Documents and Settings\David\My Documents\Flex Builder 3\test_descriptor5\src\test_descriptor5.mxml:91]
at test_descriptor5/completeHandler()[C:\Documents and Settings\David\My Documents\Flex Builder 3\test_descriptor5\src\test_descriptor5.mxml:129]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I really can't get why it's referring to a null object.
Thank you for your help
David
I'm working on a custom descriptor for openzoom, but I still have some problems showing images. My code looks like (in the "script" part of mxml file):
// data is of type XML derived from the parsing of the path,
//CustomDescriptor extends MultiScaleImageDescriptorBase and implements IMultiScaleImageDescriptor
var customDescr:CustomDescriptor = new CustomDescriptor ('somepath/descriptionfile.RDF',data)
var image:MultiScaleImage = new MultiScaleImage();
image.source = customDescr;
the execution gives the following error:
TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
at org.openzoom.flex.components::MultiScaleImage/addImage()[/Users/dani/Documents/workspace/openzoom/src/main/flash/org/openzoom/flex/components/MultiScaleImage.as:413]
at org.openzoom.flex.components::MultiScaleImage/set source()[/Users/dani/Documents/workspace/openzoom/src/main/flash/org/openzoom/flex/components/MultiScaleImage.as:144]
at test_descriptor5/eslideDescr()[C:\Documents and Settings\David\My Documents\Flex Builder 3\test_descriptor5\src\test_descriptor5.mxml:91]
at test_descriptor5/completeHandler()[C:\Documents and Settings\David\My Documents\Flex Builder 3\test_descriptor5\src\test_descriptor5.mxml:129]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I really can't get why it's referring to a null object.
Thank you for your help
David
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?David,
First, which version of the OpenZoom SDK are you using:
trunk or openzoom-preview-111.swc?
Second, when you ran this trough the debugger, which variable exactly was null?
-
Inappropriate?Sorry for the lack of infos... I'm using openzoom-preview-111.swc and I tried to understand which is the "null variable". Looking at the rows that give error in MultiscaleImage.as seems that there's something wrong with an Event, but I'm just guessing (in row 144 is called dispatchEvent( new Event( "sourceChanged" )) and in row 413 the function expects an Event).
Tomorrow I'll try with the trunk. -
Inappropriate?I am assuming you're using Flex Builder:
Try to set a breakpoint and step through the application step by step to find the source of error.
-
Inappropriate?Yes, your assumption is right :) Yesterday I tried to put breakpoints focusing on the descriptor, but it seems to not be the problem. The error comes when I try to set the MultiScaleImage source passing it the descriptor with the code of the first post.
I’m trying to find a solution
-
Inappropriate?I checked out the trunk, now is much better, at least I can go through the debug and see wich is the null variable. In the addImage() method in MultiscaleImage.as at row 184, there is a part where the code is trying to resize the scene calling:
// resize scene
container.sceneWidth = sceneWidth
container.sceneHeight = sceneHeight
the container is defined in MultiScaleImageBase.as and this is the empty variable that generates the error I posted. I also tried to create a MultiScaleContainer in the mxml file and adding the MultiscaleImage to it, but without success. Any idea on what should I do to see the scene? Thanks!
I’m still trying to find a solution
-
Inappropriate?David,
Thanks for the details. Unfortunately, it's hard to tell from here what's going wrong. Instead, I've commited an updated sample for the Flex MultiScaleImage component:
http://code.google.com/p/open-zoom/so...
This sample hopefully illustrates how to approach what you're trying to get to work.
Cheers,
Daniel
I’m confident
-
Inappropriate?Daniel,
I'm getting closer to the solution. I worked on the getTileURL and getLevelAt functions in my descriptor and now I'm seeing the image, but it is embarassing slow. It opens the image, the zoom seem to work, but after a couple of minutes explorer gives me a runtime error. Seems that the library tries to load the whole image set (all tiles at all levels), but I'm working with a huge set (1.1 gigs in 5 levels) with tiles of 25kB, and I think that it runs out of memory... Do you have experience in handling huge sets of images? Any advice to make it work properly? I think that I should load only the tiles that I can see on the screen, maybe a couple more, creating a sort of "buffer" just outside the screen. Is it possible to do the caching of the images using openzoom?
Thanks,
David
I’m feeling really close to the solution
-
Inappropriate?David,
Glad you've come that far! I am pretty sure your problems with memory stem from the fact that there's a missing/wrong implementation of IMultiScaleImage::getMinLevelForSize. This function tells the renderer which level it has to load for a given size of the image in the viewport. Check out the implementations of that method in other descriptors and I am sure you'll understand how it works. If not, let me know where you get stuck!
Good luck!
Daniel
I’m happy
-
Inappropriate?Daniel,
I tried to debug in some different ways and after commenting the following two lines in MultiScaleImageRenderer.as, seems that the speed is now decent.
layer.width = width
layer.height = height
I understood that this two lines forces the layer dimension to a default one, but I have to understand it better.
Anyway I have another question concerning the drag of the image. Now the image is opening, the zoom is working and the drag is working too, but not in the way I expected: when I drag the image, it moves the container, but not the image inside. I based my actual example on the one that you adviced me a couple of posts ago. Could that be a nesting problem in the mxml file or in the descriptor/library?
Thanks,
David
I’m looking forward to make it work properly
-
Inappropriate?Update:
please ignore the previous post, the modify to MultiScaleImageRenderer.as doesn't give an expected result and the second part of post was caused by a mistake (made by me) in getTileURL of my descriptor. Now the image that I want to see is correct, drag and zoom work correctly, but everything is still really slow, unfortunately.
I hope I can understand how to fix the performance issue soon.
David
I’m happy
-
Inappropriate?Daniel,
after other proofs, I understood what's wrong with the loading speed. It seems that the execution of the program tries to load every single tile in memory. Obviously this aspect make my prototype completely unuseful (the image set weights 1.1 GB). My objective is to load only the tiles that I see (something similar to google maps...) and putting them in memory, loading other tiles only when I see another area of the image (and eventually create a "tile deletion" logic to maintain a good performance). Do you have experience handling so big image sets? Do I really have a possibility to achieve my objective using your library?
Thanks,
David
I’m thinking if I'm on the right way
-
Inappropriate?Of course I have experience with handling large images, e.g. gigapixels, and large image sets, e.g. 100 to 500, as it this was my main motivation for developing OpenZoom.
How much larger than this OpenStreetMap sample would you like to go? I am sure there are lots of ways to optimize the library further but the functionality of the current preview release has worked pretty well for me.
Please post your project, or the portions relevant to the issues you describe, on a public repository, e.g. Google Code, to give me a chance to walk through it.
Question: Have you read my previous comments on the importance of the IMultiScaleImageDescriptor::getMinLevelForSize() method?
Please post the code of the getMinLevelForSize method of your custom descriptor.
I’m confused
-
Inappropriate?I'm sorry to bother you with stupid questions, I forgot your OpenStreetMap example and the answer was obvious ;) I'm working with images of 140000x88000 at maximum, so now I'm sure that the library can do what I need. Now the problem is how...
I read your message about IMultiScaleImageDescriptor::getMinLevelForSize(), but I fear that I didn't get 100% how it works. I tried the code of openzoomDescriptor:
public function getMinLevelForSize( width : Number,
height : Number ) : IMultiScaleImageLevel
{
var level : IMultiScaleImageLevel;
for(var i : int = numLevels-1; i >=0; i--){
level = getLevelAt(i);
if(level.width < width || level.height < height ){
break;
}
}
return getLevelAt( clamp(level.index+1,0,numLevels-1)).clone();
}
I understood that "width" and "height" passed to getMinLevelForSize are a scaling of the default values (in this case 16384 and 10300, scale 0.03333) and (I'm not sure if I'm right) in the "for" cycle it returns an image at a certain level (so after "for" cycle all the images at all the levels).
Do you think that the problem could be all in this method?
Now I try to upload the code of my descriptor in google code.
I’m confused but confident
-
Inappropriate?I uploaded the files in a google code project called eslide-viewer.
You can download the mxml file and the descriptor here:
http://code.google.com/p/eslide-viewe...
(I still have to practice how the commit of the subversion works :p )
There is also the .RDF file containing all the informations about the images set, so you can take a look at all the informations regarding my project.
Thank you for your help,
David
-
Inappropriate?David,
Thanks for uploading your test files. I did take a look at it but in order to give you a better assessment, I need you to actually commit the files to the repository. In a previous entry, I've posted a list of Subversion related tools & articles.
It is crucial to also check in a (small) test image in order to find out why this isn't working for you.
Cheers,
Daniel
-
Inappropriate?Daniel,
I've just committed my project in google code:
http://code.google.com/p/eslide-viewe...
in the downloads section you can find also a screenshot of the execution. You can see that the memory request is constantly growing until it runs out of memory (I have 2GB RAM installed). Consider that the image set is around 1.1GB and my system was using 1.04 GB RAM before launching the project. The medical image that you see is the right one, also zoom and drag are working (obviously with big delays caused by memory swapping). The image takes around a minute to be loaded starting to load tiles from the center to the bounds.
In Downloads section you can also find a .zip file called testTesi.zip that is a complete image set that I use (is the smallest I found). Probabily some tiles are not perfectly alligned, but the main problem is the performance.
I'm confident that we're really close to make it work properly,
cheers,
David
-
Inappropriate?Ciao David,
I checked out your sample project and played around with the testTesi.zip image. There are a lot of things going wrong. First of all, your tile dimension calculations set tileWidth to 720 and tileHeight to 576, while the Mac OS X Finder says your tiles are 688x566. Second, you set the levels in the wrong order. They're supposed to be in ascending order, e.g. level 0 has the lowest resolution and level numLevels - 1 the highest.
Please have a look at these issues and fix them, then we can continue debugging your custom descriptor.
Cheers,
Daniel
P.S. Please use type declarations in your ActionScript code, it really helps you in debugging.
-
Inappropriate?David,
I've created a static Eslide descriptor to demonstrate the description of the image pyramid based on the testTesi image you've provided to me. If you get all the parameters right, it seems to work. However, the image pyramid seems to have a strange architecture as the transition between levels is not very smooth.
Download this project and import it into Eclipse:
http://open-zoom.googlecode.com/files...
What do you think?
Cheers,
Daniel
-
Inappropriate?Ciao Daniel,
Don't worry about tile dimension,it is correct. As I told you in previous post I was pretty sure that were some allignment problems caused by a diversity of tile dimension between the descriptor's and the real one. This is probabily a scanning fault in phase of image acquisition, so I can't do anything to fix it. I'm sorry but that is the only small example I have. I'm working on a bigger one where the real tile dimension correspond to the descriptor's one.
For the level issue, I already tried it, but returns me black screen (without errors),that's why I tried to invert levels order. If you want to try it, you just have to comment lines 137 and 157 in my descriptor and uncomment lines138 and 158.
With this modify it creates the levels in the right order, but I can't see any image.
I'm asking me if this could be only an index problem. I mean: your folder's structure correspond to image level's structure (from 0 to N, from lowest to highest resolution), but mine is quite different because image level 0 (lowest resolution) correspond to descriptor's level N, image level 1 correspond to descriptor's level N-1 and so on.
cheers,
David -
Inappropriate?David,
Just try to build your image descriptor manually to see if your pyramid works at all. Once you've done that, just like I did in the test project available for download, you can start building the descriptor from the RDF data. There's obviously something going wrong in the description of your image pyramid from RDF. Just one problem is that you forgot to apply the right offset to your tiles. Internally they are enumareted from 0 while your files begin at 1.
Cheers,
Daniel
P.S. The reason why you got a memory overflow is exactly because your highest resolution level was internally represented as level 0, even though the OpenZoom SDK expects the lowest resolution level at index 0 (well, if you take the same algorithm for getMinLevelForSize() as I did.)
-
Inappropriate?Daniel,
I tried your example (using the checked-out library), it seems to work well for testTesi set, but when I adapt it to my m021 set, the memory consumption goes skyhigh like the image I posted in google code. In both cases the image is shown.
Using testTesi set, general memory consumption is low (~70MB) and constant, using m021 set (even with 1 level, 13 columns, 11 rows) memory consumption is higher than 1GB (with more than 1 image level, explorer crashes) and constantly growing.
I'm really confused right now... Comapring testTesi set with the first level of m021 set, the dimension are not so far away to each other, testTesi wheights around 12MB and the other around 29MB and that gives me some problems to understand that big difference in memory consumption (that makes the prototype to be not usable).
Have you posted the code of your openStreetMap example somewhere? I'd like to go through it to see if I can understand what's wrong with my code. It seems to me that in that project you handle images of 67Mx67M, right? It works perfectly with so big images, so maybe from there I could take the right idea to optimize my prototype.
cheers,
David -
Inappropriate?David,
First of all, there are no extra optimizations in the OpenStreetMap sample, it's all about correctly writing your descriptor. You say you tested your m021 sample with a single level of 13 columns by 11 rows. Why? It's pretty obvious that when you load 143 images at 500x500 or more that your memory consumption skyrockets.
The idea of an image pyramid is that the lowest level should have at most a single image and then go upwards from there, so there is never a need to load more than a couple of images at once.
If you're having so much trouble with your image pyramid & descriptor, why don't you take the easier route and use one of the existing formats such as Zoomify or Deep Zoom with more robust tools?
Cheers,
Daniel
-
Inappropriate?Daniel,
you made me think at the right thing, I hope... Probabily the set that I'm working on (the biggest one) is not complete, because the minimum level that I have is 13x11 images that as you say and I've seen, gives big problems. On monday I'll control the completeness of the case and I'm pretty sure that I'll find my answer.
I can't use Zoomify or DeepZoom because they handle only square tiles (am I right?) and I need to handle rectangular tiles that can vary from case to case.
I hope that my thought about the set's completeness is correct, I'll keep you updated,
cheers,
David
-
Inappropriate?Daniel,
my tought was right! The image set wasn't complete. Now that I have the complete set, the prototype works as expected, with good performance.
I also discovered something regarding the tile size issue: the dimension of the tiles is written in the .RDF file but inside every tile the scanner places a margin of a couple of pixels, that's why the real dimension of tiles is different from the dimensions in its descriptor. Do you know if there is a command in flex that returns an image width/height passing image's path? I found something similar but is relative to client's screen resolution
screenResolutionX:Number = Capabilities.screenResolutionX;
Another question. When I use the prototype I need to see at any time the image preview that should tell where I am inside the digital slide at every time (and probabily for every level of zoom). Do you have any experience/idea on how to do that? I'm pretty sure that in Flex is possible to obtain (I've seen it on another product), but I have no idea on how to do it.
Thanks for all the help that you gave me, I really appreciate it
David
I’m happy 'cause I'm almost done
-
Inappropriate?David,
You're welcome. Awesome! I'm really happy you've mostly got it to work!
I believe you can only get the actual dimensions of an image once you've loaded it into the Flash Player. If it's the same for all your tiles, simply load one tile and query its dimensions and set the descriptor accordingly. On the other hand, if the extra padding is uniform across all tiles, simply specify it as tile overlap. You can learn more about tile overlap in my three part series on multiscale imaging & Deep Zoom*:
http://gasi.ch/blog/inside-deep-zoom-1/
http://gasi.ch/blog/inside-deep-zoom-2/
http://gasi.ch/blog/inside-deep-zoom-3/
Considering the image preview, which I refer to as navigator, I've already implemented something along these lines but targetting Flash specifically. I believe it requires some modifications in order for it to work in Flex.
Check it out, try to make it work in Flex, and share it with us:
http://code.google.com/p/open-zoom/so...
Regards,
Daniel
* Even though it says Deep Zoom, it is highly relevant for what you're doing.
I’m happy
-
Inappropriate?Ciao Daniel,
I read the part concerning tile overlap, it is exactly what I need, but here comes the obvious question: is it possible to set the overlap both for tile width and tile height? If not, I think that it could be an interesting point for the future evolution of OpenZoom, mainly because if you can work with rectangular tiles, setting two overlaps could be really useful.
In my case I have two different overlaps that I can set manually, but I'm looking for a more elegant solution for the future.
Now I'll go through the image preview,
cheers,
David
-
Inappropriate?Daniel,
I'm going through the code of SceneNavigator.as. Do you have also any practical example on how to apply it? Does documentation exist for this class? I tried in
http://docs.openzoom.org/framework/
but I can't find it.
Cheers,
David
-
Inappropriate?David,
Tile Overlap
I disagree with you as having a non-uniform tile overlap is a reasonable option for the future. The descriptor framework I've designed is based on the most commonly used multiscale image formats out there. Out of those, only the DZI (Deep Zoom) format uses tile overlap, most probably for better rendering of large images. Without knowing your exact project, having a non-uniform tile overlap seems more like a bug than a feature.
Therefore you have two options:
1.) Adjust your horizontal and vertical tile overlaps to be uniform
or
2.) Simply make the changes to the descriptor framework to handle non-uniform tile overlaps.
After all, that's the beauty of open source.
SceneNavigator
Indeed, the class is not documented yet. It is a fairly basic component and it shouldn't be a big deal to make the modifications required for Flex.
However, if you'd rather want to build your own navigator, you can easily do that from the information of the viewport coordinates/bounds of the MultiScaleImage component.
In case you find any bugs, let me know!
Daniel
-
Inappropriate?Daniel,
thanks for your answers. Regarding tile overlap, I'll adapt manually my descriptor. The scanner that creates images sets two different margins to the tiles: a left/right one and an up/down one. I know that contraints, so this isn't a problem for my prototype, I'm just searching for a more general solution for the future. Anyway for now is not so important, it's better for me to implement the navigator.
Now I'll try to implement the navigator,
regards
David
-
Inappropriate?Hi Daniel,
I'm trying to implement the image positioning by myself looking at your SceneNavigator class. I'm adapting it because I'd like to create something that returns the position inside the preview, taking the informations from click/move made on the multiscaleimage. I use an Image (preview) and a Canvas, instead of "background" and "window" Sprites. The Canvas/window should return the position of the multiscaleimage part that I'm looking at, right?
I still haven't clear what is the "viewport" and which role does it play. I understood that it is something like a container, something like the third picture in
http://gasi.ch/blog/inside-deep-zoom-...
but I'm not 100% sure.
Other thing: does transformWindow() resize the "position rectangle" depending on the level of the multiscaleimage that is shown?
Last question: does SceneNavigator handle both repositioning (show another part of) the multiscale image by click/drag on its preview and repositioning (give an idea of where I am inside the multiscaleimage) the "preview" by click/drag on multiscale image?
I'm a bit confused...
cheers,
David
I’m a bit confused
-
Inappropriate?David,
If you think of your image (in general scene) as a rectangle of size (0, 0, 1, 1), then the viewport property tells you the coordinates of the viewing window (e.g. viewport) through which you see your image. Here's a tutorial that explains the viewport concept for Microsoft Deep Zoom:
http://blogs.msdn.com/silverlight_sdk...
The viewportWidth property works very similar in OpenZoom while the viewportOrigin is handled differently.
I suggest you to build a small sample application that listens to ViewportEvent.TRANSFORM and traces the viewport coordinates to see how it works.
To answer your last question «does SceneNavigator handle both repositioning...»: Yes, it does. But why don't you simply put together a small ActionScript only project to analyse how it works?
Good luck!
Daniel -
Inappropriate?Daniel,
I made it work almost well. I still have a little problem on repositioning when I go deeper in zoom. It seems that the tiles in portion of multiscale image shown on screen re-center themselves, but my position rectangle don't. I think that the problem could be solved with veiwportCenter, but it isn't shown as property of a viewport element.
Cheers,
David
-
Inappropriate?David,
The center of the viewport is easily calculated as viewport.x + viewport.width/2 and viewport.y + viewport.height/2.
Cheers,
Daniel
-
Inappropriate?Hi Daniel,
I'm still working on positioning inside preview and it seems more difficult than expected. I can't get how to make the position rectangle behave like the multiscale image...
I mean that if the multiscale image shows only 1 tile the proportions of repositions are satisfied. If I go deeper in zoom the tiles in multiscale image center themselves, but the position rectangle don't...
How does the tiles repositioning work? Can I avoid the automatic recentering of them in some way? How do "panTo" function (inside SceneNavigator.as) works? Is it necessary? I adapted SceneNavigator.as to my project without it...
Cheers,
David
I’m a bit confused
-
Inappropriate?David,
Frankly, I can't quite visualize what you mean by «automatic recentering.» Could you post an example online, please.
As for the IViewport.panTo() method, whether you need it depends on whether you want a two-way navigator, meaning the navigator should display the current position of the viewport within the MultiScaleImage scene as well as reposition the viewport if the navigator itself is dragged.
If you simply want a navigator that shows the position of the viewport, you'll only need to design a navigator that acts as an observer of the MultiScaleImage viewport.
Regards,
Daniel -
Inappropriate?Daniel,
you're right... Is difficult to talk about images without seeing them ;)
I made 4 screenshots, I hope they're clear. The first one is ok, the position is acceptable.
In the other 3 the problem is almost clear. To obtain these screenshots, I clicked on the green area to obtain next zoom level's screenshot (click on green area of first screenshot, produces the second one and so on).
The two blue lines into preview image delimit the right height position that the red rectangle (the position one) should have to correspond to the part of multiscale image shown.

first image

second image

third image

fourth image
Regards
David
-
Inappropriate?David,
Thanks for posting the screenshots. I can now somewhat see how the problem manifests. Is it possible that you post the positioning code of your navigator?
Regards,
Daniel
-
Inappropriate?Daniel,
I posted the whole prototype at
http://code.google.com/p/eslide-viewe...
The navigator is handled in functions transformWindow() and canv_mouseMoveHandler() in .MXML file.
The code is quite messy, I didn't cleaned yet. You'll find a lot of commented stuff with my proofs. You can ignore that.
Cheers
David
-
Inappropriate?David,
Thanks for uploading your viewer. Since you didn't include one of your test images, I tested it with a GigaPanDescriptor but I couldn't debug your navigator. Could you please make a smaller and cleaned up sample that reproduces your problem and add a small test image?
Thanks,
Daniel
P.S. BTW, you don't need to use Capabilities.screenResolutionX/Y but you can directly use percentages for your Flex components, e.g. <Label width="80%".../>. -
Inappropriate?Hi Daniel,
I cleaned the code and I uploaded a litte example. You can get the file from
http://code.google.com/p/eslide-viewe...
It contains also the set "testTesi", a complete set that give the problems shown before. It gives different responses if I use as preview image the preview image contained in the image set or the tile taken from the smallest level of zoom (2.5x in this case), because they have different dimensions. In the code you can find how to use both types of preview. Anyway both cases don't give a perfect response.
It seems that the navigator need kind of "position compensation" in transformWindow() depending on level of zoom considered, since the wrong position is more pronounced when you go deeper in zoom.
Thanks for your help,
regards
David -
Inappropriate?David,
Thanks a lot for the updated sample. It still had some hard-coded paths, e.g. C:/prototipo_local/testTesi/, but I got it to run.
Well, there's good news and there's bad news. Good news first:
Good News
Good job on the navigator. From my point of view it seems to work perfectly well. It's behavior is consistent with the navigation input I perform.
Bad News
Your image pyramid is somewhat acting weird. The subject in the image is obviously shifting between levels. This is consistent with your observation that the error in the navigator increases with higher zoom levels.
I remember seeing this problem first when I helped you with the original descriptor. At this point, I can't say if you can fix it solely with the descriptor or if your image gathering method has an inherent limitation. What I would suggest is to capture the image at its highest resolution, stitch it together and create a proper image pyramid by scaling to generate intermediate levels. I am assuming you're using some kind of microscope. Is it possible that the device is performing a shift when changing capture levels?
I am sure you'll find a solution. Otherwise, let me know how I can help!
Regards,
Daniel
I’m silly
-
Inappropriate?Daniel,
unfortunately I'm not using directly the microscope, so I can't have 100% of informations that we need. I'm trying with a little trick to compensate the navigator's movement and I found a result that seems to work well (I don't know how and why, but seems to work) that is
8*level
this value (in pixel) is subtracted to navigator's y. The "level" value should be the current level shown (I made it in a naive way just incrementing a variable when I click on the multiscale image, but obviously is not correct, because it increments also on click/drag of image, that should imply no image level changing).
Is there a way to know at any time which level of image pyramid is shown? If I can use that information I'll probabily solve this problem (ok, it won't be the most elegant solution, but I need a super fast solution, because I have to present it in 3 days) for now and then I'll fix it better with some more time.
regards
David
-
Inappropriate?David,
You can find the current level of your image with a combination of Flash's coordinate transformation methods used on the MultiScaleImageRenderer and your descriptors getMinLevelForSize method.
Good luck!
Daniel
-
Inappropriate?Hi Daniel,
I'm actually trying to understand where the problem of viewport repositioning is, and exploring the MultiscaleImageRenderer.as I found the following comment in function "createLayers":
// FIXME: Very large layer dimensions cause problems...
// Actually, they don't as long as their dimensions are powers of two.
Do you think that it could be related with my problem? I'm working on images that haven't dimensions of powers of 2 (neither tiles have). In your example "openstreetMap" do you use images/tiles of power of 2? That example works perfectly, even if I go deeper in zoom it shows the right portion of the image.
Cheers
David -
Inappropriate?David,
No, the comment you refer to in MultiScaleImageRenderer has hardly anything to do with your problem. From my limited testing of your images, it seems either your descriptor or your image pyramid is is not correct. Have you tried to manually write a descriptor by explicitly setting the dimensions of each level? If that doesn't work, you probably have to change the method of capturing your images. Basically your layer named 2.5x should be an exact copy of your 5x layer, except with dimensions half as large, and so forth.
Yes, OpenStreetMap and in general most multiscale image formats such as Google Maps, Yahoo Maps, Zoomify and Deep Zoom use image pyramids with dimensions that are based on powers of two. As I said, the most pragmatic thing you could do is create an image pyramid with one of the existing formats, e.g. Deep Zoom (DZI), using a highest resolution image as input. For example, with the Python Deep Zoom Tools I've just released or with Microsoft's Deep Zoom Composer.
How is the image data you work with usually viewed? Is there some kind of viewing application for that? Does it work there?
Regards,
Daniel -
Inappropriate?Hi Daniel
my requirement is little bit similar to david.
I have to create one preview image like david has done , once you move the small red rectangle in preview , it should reflect in main image....
Is this requirement is fullfilled by SceneNavigator.as ?
can you provide sample to show how to use it. -
Inappropriate?Ajay,
Yes the SceneNavigator component should fulfill your requirements. I suggest you to try to incorporate it in your app and when you have specific issues with it, come back and ask here.
Daniel
Loading Profile...




EMPLOYEE
